assert 2.18.4 → 2.19.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -2
  3. data/assert.gemspec +11 -5
  4. data/bin/assert +1 -0
  5. data/lib/assert.rb +20 -6
  6. data/lib/assert/actual_value.rb +26 -8
  7. data/lib/assert/assert_runner.rb +38 -17
  8. data/lib/assert/assertions.rb +145 -41
  9. data/lib/assert/cli.rb +19 -66
  10. data/lib/assert/clirb.rb +55 -0
  11. data/lib/assert/config.rb +22 -8
  12. data/lib/assert/config_helpers.rb +57 -22
  13. data/lib/assert/context.rb +28 -47
  14. data/lib/assert/context/let_dsl.rb +8 -2
  15. data/lib/assert/context/method_missing.rb +3 -0
  16. data/lib/assert/context/setup_dsl.rb +24 -16
  17. data/lib/assert/context/subject_dsl.rb +9 -7
  18. data/lib/assert/context/suite_dsl.rb +5 -1
  19. data/lib/assert/context/test_dsl.rb +58 -19
  20. data/lib/assert/context_info.rb +2 -0
  21. data/lib/assert/default_runner.rb +2 -0
  22. data/lib/assert/default_suite.rb +27 -15
  23. data/lib/assert/default_view.rb +49 -30
  24. data/lib/assert/factory.rb +2 -0
  25. data/lib/assert/file_line.rb +8 -6
  26. data/lib/assert/macro.rb +3 -1
  27. data/lib/assert/macros/methods.rb +73 -45
  28. data/lib/assert/result.rb +117 -61
  29. data/lib/assert/runner.rb +70 -51
  30. data/lib/assert/stub.rb +44 -3
  31. data/lib/assert/suite.rb +76 -38
  32. data/lib/assert/test.rb +43 -44
  33. data/lib/assert/utils.rb +22 -11
  34. data/lib/assert/version.rb +3 -1
  35. data/lib/assert/view.rb +46 -18
  36. data/lib/assert/view_helpers.rb +102 -92
  37. data/test/helper.rb +8 -4
  38. data/test/support/factory.rb +40 -21
  39. data/test/support/inherited_stuff.rb +2 -0
  40. data/test/system/stub_tests.rb +182 -144
  41. data/test/system/test_tests.rb +88 -60
  42. data/test/unit/actual_value_tests.rb +103 -46
  43. data/test/unit/assert_tests.rb +48 -40
  44. data/test/unit/assertions/assert_block_tests.rb +12 -10
  45. data/test/unit/assertions/assert_changes_tests.rb +103 -0
  46. data/test/unit/assertions/assert_empty_tests.rb +16 -12
  47. data/test/unit/assertions/assert_equal_tests.rb +46 -24
  48. data/test/unit/assertions/assert_file_exists_tests.rb +17 -13
  49. data/test/unit/assertions/assert_includes_tests.rb +12 -10
  50. data/test/unit/assertions/assert_instance_of_tests.rb +16 -14
  51. data/test/unit/assertions/assert_is_a_tests.rb +128 -0
  52. data/test/unit/assertions/assert_match_tests.rb +12 -10
  53. data/test/unit/assertions/assert_nil_tests.rb +18 -12
  54. data/test/unit/assertions/assert_raises_tests.rb +34 -23
  55. data/test/unit/assertions/assert_respond_to_tests.rb +12 -10
  56. data/test/unit/assertions/assert_same_tests.rb +26 -24
  57. data/test/unit/assertions/assert_true_false_tests.rb +34 -24
  58. data/test/unit/assertions_tests.rb +25 -17
  59. data/test/unit/config_helpers_tests.rb +15 -8
  60. data/test/unit/config_tests.rb +36 -9
  61. data/test/unit/context/let_dsl_tests.rb +2 -0
  62. data/test/unit/context/setup_dsl_tests.rb +26 -14
  63. data/test/unit/context/subject_dsl_tests.rb +5 -3
  64. data/test/unit/context/suite_dsl_tests.rb +6 -4
  65. data/test/unit/context/test_dsl_tests.rb +43 -19
  66. data/test/unit/context_info_tests.rb +6 -4
  67. data/test/unit/context_tests.rb +112 -54
  68. data/test/unit/default_runner_tests.rb +2 -0
  69. data/test/unit/default_suite_tests.rb +12 -6
  70. data/test/unit/factory_tests.rb +4 -2
  71. data/test/unit/file_line_tests.rb +9 -7
  72. data/test/unit/macro_tests.rb +13 -11
  73. data/test/unit/result_tests.rb +49 -41
  74. data/test/unit/runner_tests.rb +33 -18
  75. data/test/unit/suite_tests.rb +42 -24
  76. data/test/unit/test_tests.rb +66 -73
  77. data/test/unit/utils_tests.rb +52 -37
  78. data/test/unit/view_helpers_tests.rb +23 -14
  79. data/test/unit/view_tests.rb +7 -5
  80. metadata +40 -9
  81. data/test/unit/assertions/assert_kind_of_tests.rb +0 -66
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
 
3
5
  require "assert/config"
@@ -7,9 +9,9 @@ require "much-stub"
7
9
  module Assert
8
10
  class UnitTests < Assert::Context
9
11
  desc "Assert"
10
- subject { unit_class }
12
+ subject{ unit_class }
11
13
 
12
- let(:unit_class) { Assert }
14
+ let(:unit_class){ Assert }
13
15
 
14
16
  should have_imeths :config, :configure, :view, :suite, :runner
15
17
  should have_imeths :stubs, :stub, :unstub, :unstub!, :stub_send
@@ -19,9 +21,9 @@ module Assert
19
21
  end
20
22
 
21
23
  should "map its view, suite and runner to its config" do
22
- assert_that(subject.view).is_the_same_as(subject.config.view)
23
- assert_that(subject.suite).is_the_same_as(subject.config.suite)
24
- assert_that(subject.runner).is_the_same_as(subject.config.runner)
24
+ assert_that(subject.view).is(subject.config.view)
25
+ assert_that(subject.suite).is(subject.config.suite)
26
+ assert_that(subject.runner).is(subject.config.runner)
25
27
  end
26
28
 
27
29
  # Note: don't really need to explicitly test the configure method as
@@ -29,27 +31,20 @@ module Assert
29
31
  end
30
32
 
31
33
  class StubTests < UnitTests
32
- # setup do
33
- # orig_value1 = Factory.string
34
- # stub_value1 = Factory.string
35
-
36
- # @myclass =
37
- # Class.new do
38
- # def initialize(value); @value = value; end
39
- # def mymeth; @value; end
40
- # end
41
- # object1 = @myclass.new(orig_value1)
42
- # end
43
-
44
- let(:class1) {
34
+ let(:class1) do
45
35
  Class.new do
46
- def initialize(value); @value = value; end
47
- def mymeth; @value; end
36
+ def initialize(value)
37
+ @value = value
38
+ end
39
+
40
+ def mymeth
41
+ @value
42
+ end
48
43
  end
49
- }
50
- let(:object1) { class1.new(orig_value1) }
51
- let(:orig_value1) { Factory.string }
52
- let(:stub_value1) { Factory.string }
44
+ end
45
+ let(:object1){ class1.new(orig_value1) }
46
+ let(:orig_value1){ Factory.string }
47
+ let(:stub_value1){ Factory.string }
53
48
 
54
49
  should "build a stub" do
55
50
  stub1 = Assert.stub(object1, :mymeth)
@@ -59,9 +54,9 @@ module Assert
59
54
  should "build a stub with an on_call block" do
60
55
  my_meth_called_with = nil
61
56
  stub1 =
62
- Assert.stub_on_call(object1, :mymeth) { |call|
57
+ Assert.stub_on_call(object1, :mymeth) do |call|
63
58
  my_meth_called_with = call
64
- }
59
+ end
65
60
 
66
61
  object1.mymeth
67
62
  assert_kind_of MuchStub::Stub, stub1
@@ -71,12 +66,12 @@ module Assert
71
66
  should "lookup stubs that have been called before" do
72
67
  stub1 = Assert.stub(object1, :mymeth)
73
68
  stub2 = Assert.stub(object1, :mymeth)
74
- assert_that(stub2).is_the_same_as(stub1)
69
+ assert_that(stub2).is(stub1)
75
70
  end
76
71
 
77
72
  should "set the stub's do block if given a block" do
78
73
  Assert.stub(object1, :mymeth)
79
- assert_that(-> { object1.mymeth }).raises(MuchStub::NotStubbedError)
74
+ assert_that{ object1.mymeth }.raises(MuchStub::NotStubbedError)
80
75
  Assert.stub(object1, :mymeth){ stub_value1 }
81
76
  assert_that(object1.mymeth).equals(stub_value1)
82
77
  end
@@ -108,7 +103,7 @@ module Assert
108
103
  should "auto-unstub any stubs on teardown" do
109
104
  context_class = ::Factory.modes_off_context_class do
110
105
  setup do
111
- Assert.stub("1", :to_s){ "one" }
106
+ Assert.stub(+"1", :to_s){ "one" }
112
107
  end
113
108
  end
114
109
 
@@ -121,8 +116,9 @@ module Assert
121
116
 
122
117
  should "be able to call a stub's original method" do
123
118
  err =
124
- assert_that(-> { Assert.stub_send(object1, :mymeth) }).
125
- raises(MuchStub::NotStubbedError)
119
+ assert_that{
120
+ Assert.stub_send(object1, :mymeth)
121
+ }.raises(MuchStub::NotStubbedError)
126
122
  assert_that(err.message).includes("not stubbed.")
127
123
  assert_that(err.backtrace.first).includes("test/unit/assert_tests.rb")
128
124
 
@@ -134,9 +130,9 @@ module Assert
134
130
 
135
131
  should "be able to add a stub tap" do
136
132
  my_meth_called_with = nil
137
- Assert.stub_tap(object1, :mymeth){ |value, *args, &block|
133
+ Assert.stub_tap(object1, :mymeth) do |_value, *args|
138
134
  my_meth_called_with = args
139
- }
135
+ end
140
136
 
141
137
  assert_that(object1.mymeth).equals(orig_value1)
142
138
  assert_that(my_meth_called_with).equals([])
@@ -144,9 +140,9 @@ module Assert
144
140
 
145
141
  should "be able to add a stub tap with an on_call block" do
146
142
  my_meth_called_with = nil
147
- Assert.stub_tap_on_call(object1, :mymeth){ |value, call|
143
+ Assert.stub_tap_on_call(object1, :mymeth) do |_value, call|
148
144
  my_meth_called_with = call
149
- }
145
+ end
150
146
 
151
147
  assert_that(object1.mymeth).equals(orig_value1)
152
148
  assert_that(my_meth_called_with.args).equals([])
@@ -154,10 +150,21 @@ module Assert
154
150
 
155
151
  should "be able to add a stubbed spy" do
156
152
  myclass = Class.new do
157
- def one; self; end
158
- def two(val); self; end
159
- def three; self; end
160
- def ready?; false; end
153
+ def one
154
+ self
155
+ end
156
+
157
+ def two(_val)
158
+ self
159
+ end
160
+
161
+ def three
162
+ self
163
+ end
164
+
165
+ def ready?
166
+ false
167
+ end
161
168
  end
162
169
  myobj = myclass.new
163
170
 
@@ -167,7 +174,8 @@ module Assert
167
174
  :one,
168
175
  :two,
169
176
  :three,
170
- ready?: true)
177
+ ready?: true,
178
+ )
171
179
 
172
180
  assert_that(myobj.one).equals(spy)
173
181
  assert_that(myobj.two("a")).equals(spy)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/assertions"
3
5
 
@@ -6,15 +8,15 @@ module Assert::Assertions
6
8
  include Assert::Test::TestHelpers
7
9
 
8
10
  desc "`assert_block`"
9
- subject {
11
+ subject do
10
12
  desc = desc1
11
13
  Factory.test do
12
- assert_block { true } # pass
13
- assert_block(desc) { false } # fail
14
+ assert_block{ true } # pass
15
+ assert_block(desc){ false } # fail
14
16
  end
15
- }
17
+ end
16
18
 
17
- let(:desc1) { "assert block fail desc" }
19
+ let(:desc1){ "assert block fail desc" }
18
20
 
19
21
  should "produce results as expected" do
20
22
  subject.run(&test_run_callback)
@@ -32,15 +34,15 @@ module Assert::Assertions
32
34
  include Assert::Test::TestHelpers
33
35
 
34
36
  desc "`assert_not_block`"
35
- subject {
37
+ subject do
36
38
  desc = desc1
37
39
  Factory.test do
38
- assert_not_block(desc) { true } # fail
39
- assert_not_block { false } # pass
40
+ assert_not_block(desc){ true } # fail
41
+ assert_not_block{ false } # pass
40
42
  end
41
- }
43
+ end
42
44
 
43
- let(:desc1) { "assert not block fail desc" }
45
+ let(:desc1){ "assert not block fail desc" }
44
46
 
45
47
  should "produce results as expected" do
46
48
  subject.run(&test_run_callback)
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "assert"
4
+ require "assert/assertions"
5
+
6
+ module Assert::Assertions
7
+ class AssertChangesTests < Assert::Context
8
+ include Assert::Test::TestHelpers
9
+
10
+ desc "`assert_changes`"
11
+ subject do
12
+ desc = desc1
13
+ Factory.test do
14
+ @my_var = 1
15
+ assert_changes("@my_var", from: 1, to: 2){ @my_var = 2 } # pass
16
+ @my_var = 1
17
+ assert_changes("@my_var", from: 1){ @my_var = 2 } # pass
18
+ @my_var = 1
19
+ assert_changes("@my_var", to: 2){ @my_var = 2 } # pass
20
+ @my_var = 1
21
+ assert_changes("@my_var", desc: desc){ @my_var = 2 } # pass
22
+
23
+ @my_var = 1
24
+ assert_changes("@my_var", from: 2, to: 1){ @my_var = 2 } # fail
25
+ @my_var = 1
26
+ assert_changes("@my_var", from: 2){ @my_var = 2 } # fail
27
+ @my_var = 1
28
+ assert_changes("@my_var", to: 1){ @my_var = 2 } # fail
29
+ @my_var = 1
30
+ assert_changes("@my_var", desc: desc){ @my_var = 1 } # fail
31
+ end
32
+ end
33
+
34
+ let(:desc1){ "assert changes fail desc" }
35
+
36
+ should "produce results as expected" do
37
+ subject.run(&test_run_callback)
38
+
39
+ assert_that(test_run_result_count).equals(10)
40
+ assert_that(test_run_result_count(:pass)).equals(5)
41
+ assert_that(test_run_result_count(:fail)).equals(5)
42
+
43
+ exp =
44
+ [
45
+ "Expected `@my_var` to change from `2`",
46
+ "Expected `@my_var` to change to `1`",
47
+ "Expected `@my_var` to change from `2`",
48
+ "Expected `@my_var` to change to `1`",
49
+ "#{desc1}\nExpected `@my_var` to change; "\
50
+ "it was `1` and didn't change",
51
+ ]
52
+ messages = test_run_results(:fail).map(&:message)
53
+ messages.each_with_index do |msg, n|
54
+ assert_that(msg).matches(/^#{exp[n]}/)
55
+ end
56
+ end
57
+ end
58
+
59
+ class AssertNotChangesTests < Assert::Context
60
+ include Assert::Test::TestHelpers
61
+
62
+ desc "`assert_changes`"
63
+ subject do
64
+ desc = desc1
65
+ Factory.test do
66
+ @my_var = 1
67
+ assert_not_changes("@my_var", from: 1){ @my_var = 1 } # pass
68
+ @my_var = 1
69
+ assert_not_changes("@my_var", desc: desc){ @my_var = 1 } # pass
70
+
71
+ @my_var = 1
72
+ assert_not_changes("@my_var", from: 2){ @my_var = 1 } # fail
73
+ @my_var = 1
74
+ assert_not_changes("@my_var", from: 1){ @my_var = 2 } # fail
75
+ @my_var = 1
76
+ assert_not_changes("@my_var", desc: desc){ @my_var = 2 } # fail
77
+ end
78
+ end
79
+
80
+ let(:desc1){ "assert not changes fail desc" }
81
+
82
+ should "produce results as expected" do
83
+ subject.run(&test_run_callback)
84
+
85
+ assert_that(test_run_result_count).equals(8)
86
+ assert_that(test_run_result_count(:pass)).equals(5)
87
+ assert_that(test_run_result_count(:fail)).equals(3)
88
+
89
+ exp =
90
+ [
91
+ "Expected `@my_var` to not change from `2`",
92
+ "Expected `@my_var` to not change; "\
93
+ "it was `1` and changed to `2`",
94
+ "#{desc1}\nExpected `@my_var` to not change; "\
95
+ "it was `1` and changed to `2`",
96
+ ]
97
+ messages = test_run_results(:fail).map(&:message)
98
+ messages.each_with_index do |msg, n|
99
+ assert_that(msg).matches(/^#{exp[n]}/)
100
+ end
101
+ end
102
+ end
103
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/assertions"
3
5
 
@@ -8,17 +10,17 @@ module Assert::Assertions
8
10
  include Assert::Test::TestHelpers
9
11
 
10
12
  desc "`assert_empty`"
11
- subject {
13
+ subject do
12
14
  args = args1
13
15
  Factory.test do
14
16
  assert_empty([]) # pass
15
17
  assert_empty(*args) # fail
16
18
  end
17
- }
19
+ end
18
20
 
19
- let(:desc1) { "assert empty fail desc" }
20
- let(:args1) { [[1], desc1] }
21
- let(:config1) { subject.config }
21
+ let(:desc1){ "assert empty fail desc" }
22
+ let(:args1){ [[1], desc1] }
23
+ let(:config1){ subject.config }
22
24
 
23
25
  should "produce results as expected" do
24
26
  subject.run(&test_run_callback)
@@ -28,7 +30,8 @@ module Assert::Assertions
28
30
  assert_that(test_run_result_count(:fail)).equals(1)
29
31
 
30
32
  exp =
31
- "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to be empty."
33
+ "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to be "\
34
+ "empty."
32
35
  assert_that(test_run_results(:fail).first.message).equals(exp)
33
36
  end
34
37
  end
@@ -37,17 +40,17 @@ module Assert::Assertions
37
40
  include Assert::Test::TestHelpers
38
41
 
39
42
  desc "`assert_not_empty`"
40
- subject {
43
+ subject do
41
44
  args = args1
42
45
  Factory.test do
43
46
  assert_not_empty([1]) # pass
44
47
  assert_not_empty(*args) # fail
45
48
  end
46
- }
49
+ end
47
50
 
48
- let(:desc1) { "assert not empty fail desc" }
49
- let(:args1) { [[], desc1] }
50
- let(:config1) { subject.config }
51
+ let(:desc1){ "assert not empty fail desc" }
52
+ let(:args1){ [[], desc1] }
53
+ let(:config1){ subject.config }
51
54
 
52
55
  should "produce results as expected" do
53
56
  subject.run(&test_run_callback)
@@ -57,7 +60,8 @@ module Assert::Assertions
57
60
  assert_that(test_run_result_count(:fail)).equals(1)
58
61
 
59
62
  exp =
60
- "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not be empty."
63
+ "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not "\
64
+ "be empty."
61
65
  assert_that(test_run_results(:fail).first.message).equals(exp)
62
66
  end
63
67
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/assertions"
3
5
 
@@ -8,17 +10,17 @@ module Assert::Assertions
8
10
  include Assert::Test::TestHelpers
9
11
 
10
12
  desc "`assert_equal`"
11
- subject {
13
+ subject do
12
14
  args = args1
13
15
  Factory.test do
14
16
  assert_equal(1, 1) # pass
15
17
  assert_equal(*args) # fail
16
18
  end
17
- }
19
+ end
18
20
 
19
- let(:desc1) { "assert equal fail desc" }
20
- let(:args1) { ["1", "2", desc1] }
21
- let(:config1) { subject.config }
21
+ let(:desc1){ "assert equal fail desc" }
22
+ let(:args1){ ["1", "2", desc1] }
23
+ let(:config1){ subject.config }
22
24
 
23
25
  should "produce results as expected" do
24
26
  subject.run(&test_run_callback)
@@ -38,17 +40,17 @@ module Assert::Assertions
38
40
  include Assert::Test::TestHelpers
39
41
 
40
42
  desc "`assert_not_equal`"
41
- subject {
43
+ subject do
42
44
  args = args1
43
45
  Factory.test do
44
46
  assert_not_equal(*args) # fail
45
47
  assert_not_equal(1, 2) # pass
46
48
  end
47
- }
49
+ end
48
50
 
49
- let(:desc1) { "assert not equal fail desc" }
50
- let(:args1) { ["1", "1", desc1] }
51
- let(:config1) { subject.config }
51
+ let(:desc1){ "assert not equal fail desc" }
52
+ let(:args1){ ["1", "1", desc1] }
53
+ let(:config1){ subject.config }
52
54
 
53
55
  should "produce results as expected" do
54
56
  subject.run(&test_run_callback)
@@ -69,11 +71,31 @@ module Assert::Assertions
69
71
 
70
72
  desc "with objects that define custom equality operators"
71
73
 
72
- let(:is_class) { Class.new do; def ==(other); true; end; end }
73
- let(:is_not_class) { Class.new do; def ==(other); false; end; end }
74
+ let(:is_class) do
75
+ Class.new do
76
+ def ==(other)
77
+ if other.is_a?(Assert::ActualValue.not_given.class)
78
+ super
79
+ else
80
+ true
81
+ end
82
+ end
83
+ end
84
+ end
85
+ let(:is_not_class) do
86
+ Class.new do
87
+ def ==(other)
88
+ if other.is_a?(Assert::ActualValue.not_given.class)
89
+ super
90
+ else
91
+ false
92
+ end
93
+ end
94
+ end
95
+ end
74
96
 
75
- let(:is1) { is_class.new }
76
- let(:is_not1) { is_not_class.new }
97
+ let(:is1){ is_class.new }
98
+ let(:is_not1){ is_not_class.new }
77
99
 
78
100
  should "use the equality operator of the exp value" do
79
101
  assert_that(is1).equals(is_not1)
@@ -86,27 +108,27 @@ module Assert::Assertions
86
108
 
87
109
  desc "with objects that should use diff when showing"
88
110
 
89
- let(:config1) {
111
+ let(:config1) do
90
112
  Factory.modes_off_config.tap do |config|
91
113
  config.use_diff_proc(Assert::U.default_use_diff_proc)
92
114
  config.run_diff_proc(Assert::U.syscmd_diff_proc)
93
115
  end
94
- }
116
+ end
95
117
 
96
- let(:exp_obj1) { "I'm a\nstring" }
97
- let(:act_obj1) { "I am a \nstring" }
98
- let(:exp_obj_show1) { Assert::U.show_for_diff(exp_obj1, config1) }
99
- let(:act_obj_show1) { Assert::U.show_for_diff(act_obj1, config1) }
118
+ let(:exp_obj1){ "I'm a\nstring" }
119
+ let(:act_obj1){ "I am a \nstring" }
120
+ let(:exp_obj_show1){ Assert::U.show_for_diff(exp_obj1, config1) }
121
+ let(:act_obj_show1){ Assert::U.show_for_diff(act_obj1, config1) }
100
122
  end
101
123
 
102
124
  class AssertEqualDiffTests < DiffTests
103
125
  desc "`assert_equal`"
104
- subject {
126
+ subject do
105
127
  exp_obj, act_obj = exp_obj1, act_obj1
106
128
  Factory.test(config1) do
107
129
  assert_equal(exp_obj, act_obj)
108
130
  end
109
- }
131
+ end
110
132
 
111
133
  should "include diff output in the fail messages" do
112
134
  subject.run(&test_run_callback)
@@ -120,12 +142,12 @@ module Assert::Assertions
120
142
 
121
143
  class AssertNotEqualDiffTests < DiffTests
122
144
  desc "`assert_not_equal`"
123
- subject {
145
+ subject do
124
146
  exp_obj = exp_obj1
125
147
  Factory.test(config1) do
126
148
  assert_not_equal(exp_obj, exp_obj)
127
149
  end
128
- }
150
+ end
129
151
 
130
152
  should "include diff output in the fail messages" do
131
153
  subject.run(&test_run_callback)