Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2549 Bytes
1 | require File.dirname(__FILE__) + "/../spec_helper" |
2 | |
3 | describe Annotatable, "when included in a class" do |
4 | class BasicAnnotation |
5 | include Annotatable |
6 | end |
7 | |
8 | it "should add the annotate method to a class" do |
9 | BasicAnnotation.should respond_to(:annotate) |
10 | end |
11 | end |
12 | |
13 | describe Annotatable, "with an annotation added to a class" do |
14 | class AnnotationsAdded |
15 | include Annotatable |
16 | annotate :description |
17 | end |
18 | |
19 | it "should add class accessor methods of the given name for the annotation" do |
20 | AnnotationsAdded.should respond_to(:description) |
21 | AnnotationsAdded.should respond_to(:description=) |
22 | end |
23 | |
24 | it "should add instance accessor methods of the given name for the annotation" do |
25 | @a = AnnotationsAdded.new |
26 | @a.should respond_to(:description) |
27 | @a.should respond_to(:description=) |
28 | end |
29 | |
30 | it "should set the value of the annotation when called with a parameter" do |
31 | AnnotationsAdded.description "test" |
32 | AnnotationsAdded.description.should == "test" |
33 | end |
34 | |
35 | it "should set the value of the annotation when assigned directly" do |
36 | AnnotationsAdded.description = "test" |
37 | AnnotationsAdded.description.should == "test" |
38 | end |
39 | |
40 | it "should set the value of the annotation when called with a parameter on an instance" do |
41 | AnnotationsAdded.new.description "test" |
42 | AnnotationsAdded.description.should == "test" |
43 | end |
44 | |
45 | it "should set the value of the annotation when assigned directly on an instance" do |
46 | AnnotationsAdded.new.description = "test" |
47 | AnnotationsAdded.description.should == "test" |
48 | end |
49 | end |
50 | |
51 | describe Annotatable, "with annotations defined on a parent class" do |
52 | class ParentClass |
53 | include Annotatable |
54 | annotate :description, :url |
55 | annotate :another, :inherit => true |
56 | description "A parent class" |
57 | url "http://test.host" |
58 | another "I'm inherited!" |
59 | end |
60 | |
61 | class ChildClass < ParentClass |
62 | end |
63 | |
64 | class OverridingClass < ParentClass |
65 | another "I'm not inherited!" |
66 | end |
67 | |
68 | it "should receive all parent annotations" do |
69 | [:description, :url, :another].each do |method| |
70 | ChildClass.should respond_to(method) |
71 | end |
72 | end |
73 | |
74 | it "should inherit the parent class' values for inherit annotations" do |
75 | ChildClass.another.should == "I'm inherited!" |
76 | end |
77 | |
78 | it "should not inherit values for non-inherited annotations" do |
79 | ChildClass.description.should be_nil |
80 | ChildClass.url.should be_nil |
81 | end |
82 | |
83 | it "should override inherited values when annotated in a child class" do |
84 | OverridingClass.another.should == "I'm not inherited!" |
85 | end |
86 | end |