ratnikov-shoulda 2.9.0.1 → 2.9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -257,10 +257,10 @@ module Shoulda
257
257
  context = self
258
258
  test_unit_class.send(:define_method, test_name) do
259
259
  begin
260
- context.run_parent_setup_blocks(self)
260
+ context.run_all_setup_blocks(self)
261
+ context.run_parent_evaluate_blocks(self)
261
262
  should[:before].bind(self).call if should[:before]
262
- context.run_current_setup_blocks(self)
263
- context.run_all_evaluate_blocks(self)
263
+ context.run_current_evaluate_blocks(self)
264
264
  should[:block].bind(self).call
265
265
  ensure
266
266
  context.run_all_teardown_blocks(self)
@@ -84,7 +84,7 @@ class HelpersTest < Test::Unit::TestCase # :nodoc:
84
84
  end
85
85
 
86
86
  context "after adding another value" do
87
- setup do
87
+ evaluate do
88
88
  @a.push(4)
89
89
  end
90
90
 
@@ -96,7 +96,7 @@ class HelpersTest < Test::Unit::TestCase # :nodoc:
96
96
  end
97
97
 
98
98
  context "after replacing it with an array of strings" do
99
- setup do
99
+ evaluate do
100
100
  @a = %w(a b c d e f)
101
101
  end
102
102
 
@@ -227,22 +227,27 @@ class ShouldTest < Test::Unit::TestCase # :nodoc:
227
227
 
228
228
  context "A :before proc" do
229
229
  setup do
230
- assert_equal "before", @value
230
+ assert_nil @value, "Should not have run the before block before the setup"
231
231
  @value = "setup"
232
232
  end
233
233
 
234
- should "run before the current setup", :before => lambda { @value = "before" } do
235
- assert_equal "setup", @value
234
+ evaluate do
235
+ assert_equal "before", @value
236
+ @value = "evaluate"
237
+ end
238
+
239
+ should "run after the current setup and before the current evaluate", :before => lambda { @value = "before" } do
240
+ assert_equal "evaluate", @value
236
241
  end
237
242
  end
238
243
 
239
244
  context "a before statement" do
240
- setup do
245
+ evaluate do
241
246
  assert_equal "before", @value
242
- @value = "setup"
247
+ @value = "evaluate"
243
248
  end
244
249
 
245
- before_should "run before the current setup" do
250
+ before_should "run before the current evaluate" do
246
251
  @value = "before"
247
252
  end
248
253
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratnikov-shoulda
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0.1
4
+ version: 2.9.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tammer Saleh