cascading_classes 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,19 +23,19 @@ describe "block given" do
23
23
  end
24
24
 
25
25
  it "takes two params: value of self, parent classes" do
26
- A.score{|my_score, parents| my_score}.must_equal A.score
26
+ A.score{|my_score, parents| my_score}.should == A.score
27
27
 
28
28
  B.score = 28.2
29
- B.score{|my_score, parents| my_score}.must_equal B.score
29
+ B.score{|my_score, parents| my_score}.should == B.score
30
30
 
31
- A.new.score{|my_score| my_score}.must_equal A.new.score
32
- B.new.score{|my_score| my_score}.must_equal B.new.score
31
+ A.new.score{|my_score| my_score}.should == A.new.score
32
+ B.new.score{|my_score| my_score}.should == B.new.score
33
33
 
34
- A.score{|my_score, parents| parents}.must_equal []
35
- B.score{|my_score, parents| parents}.must_equal [A]
34
+ A.score{|my_score, parents| parents}.should == []
35
+ B.score{|my_score, parents| parents}.should == [A]
36
36
 
37
- A.new.score{|my_score, parents| parents}.must_equal [A]
38
- B.new.score{|my_score, parents| parents}.must_equal [B, A]
37
+ A.new.score{|my_score, parents| parents}.should == [A]
38
+ B.new.score{|my_score, parents| parents}.should == [B, A]
39
39
 
40
40
  =begin
41
41
  what_score, which_parents = nil, nil
@@ -45,8 +45,8 @@ describe "block given" do
45
45
  which_parents = parents
46
46
  }
47
47
 
48
- what_score.must_equal(B.score)
49
- which_parents.must_equal([A])
48
+ what_score.should ==(B.score)
49
+ which_parents.should ==([A])
50
50
  =end
51
51
  end
52
52
  end
@@ -23,16 +23,16 @@ describe "container types: typical" do
23
23
  end
24
24
 
25
25
  it "does not inherit by default" do
26
- @props[:urls][:inherit].must_equal false
27
- @props[:name][:inherit].must_equal false
26
+ @props[:urls][:inherit].should == false
27
+ @props[:name][:inherit].should == false
28
28
 
29
- A.urls.must_equal ["www.google.com"]
30
- B.urls.must_equal Array.new
31
- C.urls.must_equal Array.new
29
+ A.urls.should == ["www.google.com"]
30
+ B.urls.should == Array.new
31
+ C.urls.should == Array.new
32
32
 
33
- A.name.must_equal({:first => 'jon', :last => 'smith'})
34
- B.name.must_equal Hash.new
35
- C.name.must_equal Hash.new
33
+ A.name.should ==({:first => 'jon', :last => 'smith'})
34
+ B.name.should == Hash.new
35
+ C.name.should == Hash.new
36
36
  end
37
37
 
38
38
  describe "descendents can update their own container properties" do
@@ -47,84 +47,84 @@ describe "container types: typical" do
47
47
  end
48
48
 
49
49
  it "works" do
50
- B.urls.must_equal ["www.bing.com", "www.example.com"]
51
- C.urls.must_equal ["c.homepage.org", "example.org"]
50
+ B.urls.should == ["www.bing.com", "www.example.com"]
51
+ C.urls.should == ["c.homepage.org", "example.org"]
52
52
 
53
- B.name.must_equal({:first => 'charlie'})
54
- C.name.must_equal({:first => 'tim', :last => 'emerson'})
53
+ B.name.should ==({:first => 'charlie'})
54
+ C.name.should ==({:first => 'tim', :last => 'emerson'})
55
55
  end
56
56
  end
57
57
 
58
58
  describe "manual override: allowing inheritance" do
59
59
  it "accepts ':inherit' syntax" do
60
- B.urls(:inherit).must_equal ["www.google.com"]
61
- C.urls(:inherit).must_equal ["www.google.com"]
60
+ B.urls(:inherit).should == ["www.google.com"]
61
+ C.urls(:inherit).should == ["www.google.com"]
62
62
 
63
- B.name(:inherit).must_equal({:first => 'jon', :last => 'smith'})
64
- C.name(:inherit).must_equal({:first => 'jon', :last => 'smith'})
63
+ B.name(:inherit).should ==({:first => 'jon', :last => 'smith'})
64
+ C.name(:inherit).should ==({:first => 'jon', :last => 'smith'})
65
65
  end
66
66
 
67
67
  it "accepts ':inherit => <val>' syntax" do
68
- B.urls(:inherit => 0).must_equal []
69
- B.urls(:inherit => false).must_equal []
70
- B.urls(:inherit => nil).must_equal []
71
- B.urls(:inherit => 1).must_equal ["www.google.com"]
72
- B.urls(:inherit => true).must_equal ["www.google.com"]
73
- B.urls(:inherit => -1).must_equal ["www.google.com"]
74
-
75
- C.urls(:inherit => 0).must_equal []
76
- C.urls(:inherit => false).must_equal []
77
- C.urls(:inherit => nil).must_equal []
78
- C.urls(:inherit => 1).must_equal []
79
- C.urls(:inherit => 2).must_equal ["www.google.com"]
80
- C.urls(:inherit => -1).must_equal ["www.google.com"]
81
- C.urls(:inherit => true).must_equal ["www.google.com"]
68
+ B.urls(:inherit => 0).should == []
69
+ B.urls(:inherit => false).should == []
70
+ B.urls(:inherit => nil).should == []
71
+ B.urls(:inherit => 1).should == ["www.google.com"]
72
+ B.urls(:inherit => true).should == ["www.google.com"]
73
+ B.urls(:inherit => -1).should == ["www.google.com"]
74
+
75
+ C.urls(:inherit => 0).should == []
76
+ C.urls(:inherit => false).should == []
77
+ C.urls(:inherit => nil).should == []
78
+ C.urls(:inherit => 1).should == []
79
+ C.urls(:inherit => 2).should == ["www.google.com"]
80
+ C.urls(:inherit => -1).should == ["www.google.com"]
81
+ C.urls(:inherit => true).should == ["www.google.com"]
82
82
  end
83
83
 
84
84
  it "accepts ':inherit, <val>' syntax" do
85
- B.name(:inherit, 0).must_equal Hash.new
86
- B.name(:inherit, false).must_equal Hash.new
87
- B.name(:inherit, nil).must_equal Hash.new
88
- B.name(:inherit, 1).must_equal({:first => 'jon', :last => 'smith'})
89
- B.name(:inherit, true).must_equal({:first => 'jon', :last => 'smith'})
90
- B.name(:inherit, -1).must_equal({:first => 'jon', :last => 'smith'})
91
-
92
- C.name(:inherit, 0).must_equal Hash.new
93
- C.name(:inherit, false).must_equal Hash.new
94
- C.name(:inherit, nil).must_equal Hash.new
95
- C.name(:inherit, 1).must_equal Hash.new
96
- C.name(:inherit, 2).must_equal({:first => 'jon', :last => 'smith'})
97
- C.name(:inherit, true).must_equal({:first => 'jon', :last => 'smith'})
98
- C.name(:inherit, -1).must_equal({:first => 'jon', :last => 'smith'})
85
+ B.name(:inherit, 0).should == Hash.new
86
+ B.name(:inherit, false).should == Hash.new
87
+ B.name(:inherit, nil).should == Hash.new
88
+ B.name(:inherit, 1).should ==({:first => 'jon', :last => 'smith'})
89
+ B.name(:inherit, true).should ==({:first => 'jon', :last => 'smith'})
90
+ B.name(:inherit, -1).should ==({:first => 'jon', :last => 'smith'})
91
+
92
+ C.name(:inherit, 0).should == Hash.new
93
+ C.name(:inherit, false).should == Hash.new
94
+ C.name(:inherit, nil).should == Hash.new
95
+ C.name(:inherit, 1).should == Hash.new
96
+ C.name(:inherit, 2).should ==({:first => 'jon', :last => 'smith'})
97
+ C.name(:inherit, true).should ==({:first => 'jon', :last => 'smith'})
98
+ C.name(:inherit, -1).should ==({:first => 'jon', :last => 'smith'})
99
99
  end
100
100
 
101
101
  describe "manual override has no effect on non-blank container properties" do
102
102
  it "works" do
103
103
  C.urls << "www.yahoo.com"
104
104
 
105
- A.urls_is_blank?.must_equal false
106
- B.urls_is_blank?.must_equal true
107
- C.urls_is_blank?.must_equal false
108
-
109
- A.urls.must_equal ["www.google.com"]
110
- A.urls(:inherit).must_equal ["www.google.com"]
111
- A.urls(:inherit => false).must_equal ["www.google.com"]
112
- A.urls(:inherit => nil).must_equal ["www.google.com"]
113
- A.urls(:inherit => 0).must_equal ["www.google.com"]
114
- A.urls(:inherit => 1).must_equal ["www.google.com"]
115
- A.urls(:inherit => 2).must_equal ["www.google.com"]
116
- A.urls(:inherit => -1).must_equal ["www.google.com"]
117
- A.urls(:inherit => true).must_equal ["www.google.com"]
118
-
119
- C.urls.must_equal ["www.yahoo.com"]
120
- C.urls(:inherit).must_equal ["www.yahoo.com"]
121
- C.urls(:inherit, false).must_equal ["www.yahoo.com"]
122
- C.urls(:inherit, nil).must_equal ["www.yahoo.com"]
123
- C.urls(:inherit, 0).must_equal ["www.yahoo.com"]
124
- C.urls(:inherit, 1).must_equal ["www.yahoo.com"]
125
- C.urls(:inherit, 2).must_equal ["www.yahoo.com"]
126
- C.urls(:inherit, -1).must_equal ["www.yahoo.com"]
127
- C.urls(:inherit, true).must_equal ["www.yahoo.com"]
105
+ A.urls_is_blank?.should == false
106
+ B.urls_is_blank?.should == true
107
+ C.urls_is_blank?.should == false
108
+
109
+ A.urls.should == ["www.google.com"]
110
+ A.urls(:inherit).should == ["www.google.com"]
111
+ A.urls(:inherit => false).should == ["www.google.com"]
112
+ A.urls(:inherit => nil).should == ["www.google.com"]
113
+ A.urls(:inherit => 0).should == ["www.google.com"]
114
+ A.urls(:inherit => 1).should == ["www.google.com"]
115
+ A.urls(:inherit => 2).should == ["www.google.com"]
116
+ A.urls(:inherit => -1).should == ["www.google.com"]
117
+ A.urls(:inherit => true).should == ["www.google.com"]
118
+
119
+ C.urls.should == ["www.yahoo.com"]
120
+ C.urls(:inherit).should == ["www.yahoo.com"]
121
+ C.urls(:inherit, false).should == ["www.yahoo.com"]
122
+ C.urls(:inherit, nil).should == ["www.yahoo.com"]
123
+ C.urls(:inherit, 0).should == ["www.yahoo.com"]
124
+ C.urls(:inherit, 1).should == ["www.yahoo.com"]
125
+ C.urls(:inherit, 2).should == ["www.yahoo.com"]
126
+ C.urls(:inherit, -1).should == ["www.yahoo.com"]
127
+ C.urls(:inherit, true).should == ["www.yahoo.com"]
128
128
  end
129
129
  end
130
130
  end
@@ -149,14 +149,14 @@ describe "container types: property-wide inheritance" do
149
149
  end
150
150
 
151
151
  it "inherits by default" do
152
- @props[:urls][:inherit].must_equal true
153
- @props[:name][:inherit].must_equal true
152
+ @props[:urls][:inherit].should == true
153
+ @props[:name][:inherit].should == true
154
154
 
155
- B.urls.must_equal ["www.google.com"]
156
- C.urls.must_equal ["www.google.com"]
155
+ B.urls.should == ["www.google.com"]
156
+ C.urls.should == ["www.google.com"]
157
157
 
158
- B.name.must_equal({:first => 'jon', :last => 'smith'})
159
- C.name.must_equal({:first => 'jon', :last => 'smith'})
158
+ B.name.should ==({:first => 'jon', :last => 'smith'})
159
+ C.name.should ==({:first => 'jon', :last => 'smith'})
160
160
  end
161
161
 
162
162
  describe "a descendent updates a container property" do
@@ -165,37 +165,37 @@ describe "container types: property-wide inheritance" do
165
165
  end
166
166
 
167
167
  it "cascades down its descendents" do
168
- C.urls.must_equal ["www.bing.com"]
168
+ C.urls.should == ["www.bing.com"]
169
169
  end
170
170
  end
171
171
 
172
172
  describe "overriding the inheritance effect" do
173
173
  it "accepts ':inherit => <val>' syntax" do
174
- B.urls.must_equal ["www.google.com"]
175
- C.urls.must_equal ["www.google.com"]
174
+ B.urls.should == ["www.google.com"]
175
+ C.urls.should == ["www.google.com"]
176
176
 
177
- B.urls(:inherit => false).must_equal []
178
- C.urls(:inherit => false).must_equal []
177
+ B.urls(:inherit => false).should == []
178
+ C.urls(:inherit => false).should == []
179
179
 
180
- B.urls(:inherit => 0).must_equal []
181
- C.urls(:inherit => 0).must_equal []
180
+ B.urls(:inherit => 0).should == []
181
+ C.urls(:inherit => 0).should == []
182
182
 
183
- B.urls(:inherit => 1).must_equal ["www.google.com"]
184
- C.urls(:inherit => 1).must_equal []
183
+ B.urls(:inherit => 1).should == ["www.google.com"]
184
+ C.urls(:inherit => 1).should == []
185
185
  end
186
186
 
187
187
  it "accepts ':inherit, <val>' syntax" do
188
- B.urls.must_equal ["www.google.com"]
189
- C.urls.must_equal ["www.google.com"]
188
+ B.urls.should == ["www.google.com"]
189
+ C.urls.should == ["www.google.com"]
190
190
 
191
- B.urls(:inherit, false).must_equal []
192
- C.urls(:inherit, false).must_equal []
191
+ B.urls(:inherit, false).should == []
192
+ C.urls(:inherit, false).should == []
193
193
 
194
- B.urls(:inherit, 0).must_equal []
195
- C.urls(:inherit, 0).must_equal []
194
+ B.urls(:inherit, 0).should == []
195
+ C.urls(:inherit, 0).should == []
196
196
 
197
- B.urls(:inherit, 1).must_equal ["www.google.com"]
198
- C.urls(:inherit, 1).must_equal []
197
+ B.urls(:inherit, 1).should == ["www.google.com"]
198
+ C.urls(:inherit, 1).should == []
199
199
  end
200
200
  end
201
201
  end
@@ -37,56 +37,56 @@ describe "inherit" do
37
37
 
38
38
  describe "descendents" do
39
39
  it "inherits symbols strings, fixnums, floats, and bools (by default)" do
40
- @props[:location][:inherit].must_equal true
41
- @props[:weather][:inherit].must_equal true
42
- @props[:num][:inherit].must_equal true
43
- @props[:score][:inherit].must_equal true
44
- @props[:available][:inherit].must_equal true
40
+ @props[:location][:inherit].should == true
41
+ @props[:weather][:inherit].should == true
42
+ @props[:num][:inherit].should == true
43
+ @props[:score][:inherit].should == true
44
+ @props[:available][:inherit].should == true
45
45
 
46
- B.location.must_equal "south side"
47
- C.location.must_equal "south side"
46
+ B.location.should == "south side"
47
+ C.location.should == "south side"
48
48
 
49
- B.weather.must_equal :sunny
50
- C.weather.must_equal :sunny
49
+ B.weather.should == :sunny
50
+ C.weather.should == :sunny
51
51
 
52
- B.num.must_equal 12
53
- C.num.must_equal 12
52
+ B.num.should == 12
53
+ C.num.should == 12
54
54
 
55
- B.score.must_equal 32.18
56
- C.score.must_equal 32.18
55
+ B.score.should == 32.18
56
+ C.score.should == 32.18
57
57
 
58
- B.available.must_equal false
59
- C.available.must_equal false
58
+ B.available.should == false
59
+ C.available.should == false
60
60
  end
61
61
 
62
62
  it "doesn't inherit containers like hashes, arrays, and sets (by default)" do
63
- @props[:name][:inherit].must_equal false
64
- @props[:groceries][:inherit].must_equal false
63
+ @props[:name][:inherit].should == false
64
+ @props[:groceries][:inherit].should == false
65
65
 
66
- B.name.must_equal Hash.new
67
- C.name.must_equal Hash.new
66
+ B.name.should == Hash.new
67
+ C.name.should == Hash.new
68
68
 
69
- B.groceries.must_equal Array.new
70
- C.groceries.must_equal Array.new
69
+ B.groceries.should == Array.new
70
+ C.groceries.should == Array.new
71
71
 
72
- B.ingredients.must_equal Set.new
73
- C.ingredients.must_equal Set.new
72
+ B.ingredients.should == Set.new
73
+ C.ingredients.should == Set.new
74
74
  end
75
75
 
76
76
  it "inherits properties of type ':Proc'" do
77
- @props[:mood][:inherit].must_equal true
77
+ @props[:mood][:inherit].should == true
78
78
 
79
79
  A.weather = :sunny
80
80
  B.weather = :rainy
81
81
 
82
- C.weather.must_equal :rainy
82
+ C.weather.should == :rainy
83
83
 
84
- A.mood.must_equal "content"
85
- B.mood.must_equal "depressed"
86
- C.mood.must_equal "depressed"
84
+ A.mood.should == "content"
85
+ B.mood.should == "depressed"
86
+ C.mood.should == "depressed"
87
87
 
88
88
  C.weather = :sunny
89
- C.mood.must_equal "content"
89
+ C.mood.should == "content"
90
90
  end
91
91
  end
92
92
  end
@@ -112,124 +112,124 @@ describe "inherit" do
112
112
  end
113
113
 
114
114
  it "allows 'false', 'nil' and '0' to force no inheritance" do
115
- B.location(false).must_equal ""
116
- C.location(false).must_equal ""
115
+ B.location(false).should == ""
116
+ C.location(false).should == ""
117
117
 
118
- B.score(nil).must_equal nil
119
- C.score(nil).must_equal nil
118
+ B.score(nil).should == nil
119
+ C.score(nil).should == nil
120
120
 
121
- B.weather(0).must_equal nil
122
- C.weather(0).must_equal nil
121
+ B.weather(0).should == nil
122
+ C.weather(0).should == nil
123
123
  end
124
124
 
125
125
  it "allows 'true', '-1' to force full, inifinte max inheritance" do
126
- B.num(true).must_equal 12
127
- C.num(true).must_equal 12
126
+ B.num(true).should == 12
127
+ C.num(true).should == 12
128
128
 
129
- B.groceries(-1).must_equal [:ice, :lemons, :splenda]
130
- C.groceries(-1).must_equal [:ice, :lemons, :splenda]
129
+ B.groceries(-1).should == [:ice, :lemons, :splenda]
130
+ C.groceries(-1).should == [:ice, :lemons, :splenda]
131
131
  end
132
132
 
133
133
  it "allows '<fixnum>' value to indicate max inheritance age" do
134
- B.score(0).must_equal nil
135
- B.score(1).must_equal 32.18
136
- B.score(2).must_equal 32.18
137
- C.score(1).must_equal nil
138
- C.score(2).must_equal 32.18
139
-
140
- B.name(0).must_equal Hash.new
141
- B.name(1).must_equal({:first => 'jon', :last => 'smith'})
142
- C.name(0).must_equal Hash.new
143
- C.name(1).must_equal Hash.new
144
- C.name(2).must_equal({:first => 'jon', :last => 'smith'})
134
+ B.score(0).should == nil
135
+ B.score(1).should == 32.18
136
+ B.score(2).should == 32.18
137
+ C.score(1).should == nil
138
+ C.score(2).should == 32.18
139
+
140
+ B.name(0).should == Hash.new
141
+ B.name(1).should ==({:first => 'jon', :last => 'smith'})
142
+ C.name(0).should == Hash.new
143
+ C.name(1).should == Hash.new
144
+ C.name(2).should ==({:first => 'jon', :last => 'smith'})
145
145
  end
146
146
 
147
147
  it "allows ':inherit => false' and ':inherit => nil' syntax" do
148
- B.location(:inherit => false).must_equal ""
148
+ B.location(:inherit => false).should == ""
149
149
  c_location = C.location :inherit => false
150
- c_location.must_equal ""
150
+ c_location.should == ""
151
151
 
152
- B.weather(:inherit => nil).must_equal nil
152
+ B.weather(:inherit => nil).should == nil
153
153
  c_weather = C.weather :inherit => nil
154
- c_weather.must_equal nil
154
+ c_weather.should == nil
155
155
  end
156
156
 
157
157
  it "allows ':inhert, false' and ':inherit, nil' syntax" do
158
- B.num(:inherit, false).must_equal nil
158
+ B.num(:inherit, false).should == nil
159
159
  c_num = C.num :inherit, false
160
- c_num.must_equal nil
160
+ c_num.should == nil
161
161
 
162
- B.score(:inherit, nil).must_equal nil
162
+ B.score(:inherit, nil).should == nil
163
163
  c_score = C.score :inherit, nil
164
- c_score.must_equal nil
164
+ c_score.should == nil
165
165
  end
166
166
 
167
167
  it "allows ':inherit => true' and ':inherit => -1' syntax" do
168
- B.name(:inherit => true).must_equal({:first => 'jon', :last => 'smith'})
168
+ B.name(:inherit => true).should ==({:first => 'jon', :last => 'smith'})
169
169
  c_name = C.name :inherit => true
170
- c_name.must_equal({:first => 'jon', :last => 'smith'})
170
+ c_name.should ==({:first => 'jon', :last => 'smith'})
171
171
 
172
- B.groceries(:inherit => -1).must_equal [:ice, :lemons, :splenda]
172
+ B.groceries(:inherit => -1).should == [:ice, :lemons, :splenda]
173
173
  c_groceries = C.groceries :inherit => -1
174
- c_groceries.must_equal [:ice, :lemons, :splenda]
174
+ c_groceries.should == [:ice, :lemons, :splenda]
175
175
  end
176
176
 
177
177
  it "allows ':inherit, true' and ':inherit, -1' syntax" do
178
- B.ingredients(:inherit, true).must_equal Set.new([:sugar, :butter, :flour, :eggs])
178
+ B.ingredients(:inherit, true).should == Set.new([:sugar, :butter, :flour, :eggs])
179
179
  c_ingredients = C.ingredients :inherit, true
180
- c_ingredients.must_equal Set.new([:sugar, :butter, :flour, :eggs])
180
+ c_ingredients.should == Set.new([:sugar, :butter, :flour, :eggs])
181
181
 
182
- B.name(:inherit, -1).must_equal({:first => 'jon', :last => 'smith'})
182
+ B.name(:inherit, -1).should ==({:first => 'jon', :last => 'smith'})
183
183
  c_name = C.name :inherit, -1
184
- c_name.must_equal({:first => 'jon', :last => 'smith'})
184
+ c_name.should ==({:first => 'jon', :last => 'smith'})
185
185
  end
186
186
 
187
187
  it "allows ':inherit => <n>' (n: fixnum) syntax" do
188
- B.location(:inherit => 0).must_equal ''
189
- B.location(:inherit => 1).must_equal "south side"
188
+ B.location(:inherit => 0).should == ''
189
+ B.location(:inherit => 1).should == "south side"
190
190
 
191
191
  c_loc_0 = C.location :inherit => 0
192
192
  c_loc_1 = C.location :inherit => 1
193
193
  c_loc_2 = C.location :inherit => 2
194
194
 
195
- c_loc_0.must_equal ''
196
- c_loc_1.must_equal ''
197
- c_loc_2.must_equal "south side"
195
+ c_loc_0.should == ''
196
+ c_loc_1.should == ''
197
+ c_loc_2.should == "south side"
198
198
 
199
- B.groceries(:inherit => 0).must_equal []
200
- B.groceries(:inherit => 1).must_equal [:ice, :lemons, :splenda]
199
+ B.groceries(:inherit => 0).should == []
200
+ B.groceries(:inherit => 1).should == [:ice, :lemons, :splenda]
201
201
 
202
202
  c_groc_0 = C.groceries :inherit => 0
203
203
  c_groc_1 = C.groceries :inherit => 1
204
204
  c_groc_2 = C.groceries :inherit => 2
205
205
 
206
- c_groc_0.must_equal []
207
- c_groc_1.must_equal []
208
- c_groc_2.must_equal [:ice, :lemons, :splenda]
206
+ c_groc_0.should == []
207
+ c_groc_1.should == []
208
+ c_groc_2.should == [:ice, :lemons, :splenda]
209
209
  end
210
210
 
211
211
  it "allows ':inherit, <n>' (n: fixnum) syntax" do
212
- B.score(:inherit, 0).must_equal nil
213
- B.score(:inherit, 1).must_equal 32.18
212
+ B.score(:inherit, 0).should == nil
213
+ B.score(:inherit, 1).should == 32.18
214
214
 
215
215
  c_score_0 = C.score :inherit, 0
216
216
  c_score_1 = C.score :inherit, 1
217
217
  c_score_2 = C.score :inherit, 2
218
218
 
219
- c_score_0.must_equal nil
220
- c_score_1.must_equal nil
221
- c_score_2.must_equal 32.18
219
+ c_score_0.should == nil
220
+ c_score_1.should == nil
221
+ c_score_2.should == 32.18
222
222
 
223
- B.ingredients(:inherit, 0).must_equal Set.new([])
224
- B.ingredients(:inherit, 1).must_equal Set.new([:sugar, :butter, :flour, :eggs])
223
+ B.ingredients(:inherit, 0).should == Set.new([])
224
+ B.ingredients(:inherit, 1).should == Set.new([:sugar, :butter, :flour, :eggs])
225
225
 
226
226
  c_ingr_0 = C.ingredients :inherit, 0
227
227
  c_ingr_1 = C.ingredients :inherit, 1
228
228
  c_ingr_2 = C.ingredients :inherit, 2
229
229
 
230
- c_ingr_0.must_equal Set.new([])
231
- c_ingr_1.must_equal Set.new([])
232
- c_ingr_2.must_equal Set.new([:sugar, :butter, :flour, :eggs])
230
+ c_ingr_0.should == Set.new([])
231
+ c_ingr_1.should == Set.new([])
232
+ c_ingr_2.should == Set.new([:sugar, :butter, :flour, :eggs])
233
233
  end
234
234
  end
235
235
 
@@ -252,85 +252,85 @@ describe "inherit" do
252
252
  end
253
253
 
254
254
  it "all should not inherit" do
255
- @props[:location][:inherit].must_equal false
256
- @props[:score][:inherit].must_equal false
257
- @props[:num][:inherit].must_equal false
258
- @props[:weather][:inherit].must_equal false
259
- @props[:available][:inherit].must_equal false
260
- @props[:mood][:inherit].must_equal false
261
- @props[:color][:inherit].must_equal false
262
- @props[:groceries][:inherit].must_equal false
263
- @props[:ingredients][:inherit].must_equal false
264
-
265
- A.location.must_equal "south side"
266
- B.location.must_equal ''
267
- C.location.must_equal ''
268
-
269
- A.score.must_equal 32.18
270
- B.score.must_equal nil
271
- C.score.must_equal nil
272
-
273
- A.num.must_equal 12
274
- B.num.must_equal nil
275
- C.num.must_equal nil
276
-
277
- A.weather.must_equal :sunny
278
- B.weather.must_equal nil
279
- C.weather.must_equal nil
280
-
281
- A.available.must_equal false
282
- B.available.must_equal nil
283
- C.available.must_equal nil
284
-
285
- A.mood.must_equal "content"
286
- B.mood.must_equal "depressed"
287
- C.mood.must_equal "depressed"
288
-
289
- A.color.must_equal "rosy"
290
- B.color.must_equal "B: blue"
291
- C.color.must_equal "blue"
292
-
293
- A.name.must_equal({:first => 'jon', :last => 'smith'})
294
- B.name.must_equal Hash.new
295
- C.name.must_equal Hash.new
296
-
297
- A.groceries.must_equal [:ice, :lemons, :splenda]
298
- B.groceries.must_equal Array.new
299
- C.groceries.must_equal Array.new
300
-
301
- A.ingredients.must_equal Set.new([:sugar, :butter, :flour, :eggs])
302
- B.ingredients.must_equal Set.new
303
- C.ingredients.must_equal Set.new
255
+ @props[:location][:inherit].should == false
256
+ @props[:score][:inherit].should == false
257
+ @props[:num][:inherit].should == false
258
+ @props[:weather][:inherit].should == false
259
+ @props[:available][:inherit].should == false
260
+ @props[:mood][:inherit].should == false
261
+ @props[:color][:inherit].should == false
262
+ @props[:groceries][:inherit].should == false
263
+ @props[:ingredients][:inherit].should == false
264
+
265
+ A.location.should == "south side"
266
+ B.location.should == ''
267
+ C.location.should == ''
268
+
269
+ A.score.should == 32.18
270
+ B.score.should == nil
271
+ C.score.should == nil
272
+
273
+ A.num.should == 12
274
+ B.num.should == nil
275
+ C.num.should == nil
276
+
277
+ A.weather.should == :sunny
278
+ B.weather.should == nil
279
+ C.weather.should == nil
280
+
281
+ A.available.should == false
282
+ B.available.should == nil
283
+ C.available.should == nil
284
+
285
+ A.mood.should == "content"
286
+ B.mood.should == "depressed"
287
+ C.mood.should == "depressed"
288
+
289
+ A.color.should == "rosy"
290
+ B.color.should == "B: blue"
291
+ C.color.should == "blue"
292
+
293
+ A.name.should ==({:first => 'jon', :last => 'smith'})
294
+ B.name.should == Hash.new
295
+ C.name.should == Hash.new
296
+
297
+ A.groceries.should == [:ice, :lemons, :splenda]
298
+ B.groceries.should == Array.new
299
+ C.groceries.should == Array.new
300
+
301
+ A.ingredients.should == Set.new([:sugar, :butter, :flour, :eggs])
302
+ B.ingredients.should == Set.new
303
+ C.ingredients.should == Set.new
304
304
  end
305
305
 
306
306
  describe "manual inheritance age override" do
307
307
  it "allows 'true' and '-1' syntax" do
308
- B.location(true).must_equal "south side"
309
- C.location(true).must_equal "south side"
308
+ B.location(true).should == "south side"
309
+ C.location(true).should == "south side"
310
310
 
311
- B.score(-1).must_equal 32.18
312
- C.score(-1).must_equal 32.18
311
+ B.score(-1).should == 32.18
312
+ C.score(-1).should == 32.18
313
313
 
314
- B.ingredients(true).must_equal Set.new([:sugar, :butter, :flour, :eggs])
315
- C.ingredients(true).must_equal Set.new([:sugar, :butter, :flour, :eggs])
314
+ B.ingredients(true).should == Set.new([:sugar, :butter, :flour, :eggs])
315
+ C.ingredients(true).should == Set.new([:sugar, :butter, :flour, :eggs])
316
316
  end
317
317
 
318
318
  it "allows <fixnum> (n > 0) syntax to indicate max inheritance age" do
319
- B.weather(0).must_equal nil
320
- B.weather(1).must_equal :sunny
321
- B.weather(2).must_equal :sunny
322
- C.weather(0).must_equal nil
323
- C.weather(1).must_equal nil
324
- C.weather(2).must_equal :sunny
325
- C.weather(3).must_equal :sunny
326
-
327
- B.groceries(0).must_equal Array.new
328
- B.groceries(1).must_equal [:ice, :lemons, :splenda]
329
- B.groceries(2).must_equal [:ice, :lemons, :splenda]
330
- C.groceries(0).must_equal Array.new
331
- C.groceries(1).must_equal Array.new
332
- C.groceries(2).must_equal Array.new [:ice, :lemons, :splenda]
333
- C.groceries(3).must_equal Array.new [:ice, :lemons, :splenda]
319
+ B.weather(0).should == nil
320
+ B.weather(1).should == :sunny
321
+ B.weather(2).should == :sunny
322
+ C.weather(0).should == nil
323
+ C.weather(1).should == nil
324
+ C.weather(2).should == :sunny
325
+ C.weather(3).should == :sunny
326
+
327
+ B.groceries(0).should == Array.new
328
+ B.groceries(1).should == [:ice, :lemons, :splenda]
329
+ B.groceries(2).should == [:ice, :lemons, :splenda]
330
+ C.groceries(0).should == Array.new
331
+ C.groceries(1).should == Array.new
332
+ C.groceries(2).should == Array.new [:ice, :lemons, :splenda]
333
+ C.groceries(3).should == Array.new [:ice, :lemons, :splenda]
334
334
  end
335
335
  end
336
336
  end