assert 2.16.5 → 2.18.3

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.
Files changed (82) hide show
  1. checksums.yaml +7 -7
  2. data/Gemfile +3 -1
  3. data/README.md +79 -54
  4. data/assert.gemspec +6 -5
  5. data/bin/assert +4 -4
  6. data/lib/assert.rb +8 -18
  7. data/lib/assert/actual_value.rb +127 -0
  8. data/lib/assert/assert_runner.rb +7 -10
  9. data/lib/assert/assertions.rb +15 -28
  10. data/lib/assert/cli.rb +41 -57
  11. data/lib/assert/config.rb +8 -12
  12. data/lib/assert/config_helpers.rb +6 -10
  13. data/lib/assert/context.rb +30 -24
  14. data/lib/assert/context/let_dsl.rb +13 -0
  15. data/lib/assert/context/method_missing.rb +19 -0
  16. data/lib/assert/context/setup_dsl.rb +0 -4
  17. data/lib/assert/context/subject_dsl.rb +0 -4
  18. data/lib/assert/context/suite_dsl.rb +0 -4
  19. data/lib/assert/context/test_dsl.rb +5 -9
  20. data/lib/assert/context_info.rb +2 -6
  21. data/lib/assert/default_runner.rb +1 -5
  22. data/lib/assert/default_suite.rb +1 -6
  23. data/lib/assert/default_view.rb +8 -12
  24. data/lib/assert/factory.rb +1 -4
  25. data/lib/assert/file_line.rb +0 -4
  26. data/lib/assert/macro.rb +1 -4
  27. data/lib/assert/macros/methods.rb +5 -11
  28. data/lib/assert/result.rb +19 -34
  29. data/lib/assert/runner.rb +12 -11
  30. data/lib/assert/stub.rb +16 -2
  31. data/lib/assert/suite.rb +3 -7
  32. data/lib/assert/test.rb +13 -18
  33. data/lib/assert/utils.rb +8 -12
  34. data/lib/assert/version.rb +1 -1
  35. data/lib/assert/view.rb +18 -21
  36. data/lib/assert/view_helpers.rb +6 -17
  37. data/log/{.gitkeep → .keep} +0 -0
  38. data/test/helper.rb +26 -41
  39. data/test/support/factory.rb +20 -6
  40. data/test/support/inherited_stuff.rb +0 -2
  41. data/test/system/stub_tests.rb +350 -354
  42. data/test/system/test_tests.rb +119 -133
  43. data/test/unit/actual_value_tests.rb +335 -0
  44. data/test/unit/assert_tests.rb +125 -52
  45. data/test/unit/assertions/assert_block_tests.rb +34 -37
  46. data/test/unit/assertions/assert_empty_tests.rb +38 -38
  47. data/test/unit/assertions/assert_equal_tests.rb +84 -86
  48. data/test/unit/assertions/assert_file_exists_tests.rb +37 -39
  49. data/test/unit/assertions/assert_includes_tests.rb +45 -46
  50. data/test/unit/assertions/assert_instance_of_tests.rb +39 -40
  51. data/test/unit/assertions/assert_kind_of_tests.rb +39 -40
  52. data/test/unit/assertions/assert_match_tests.rb +39 -40
  53. data/test/unit/assertions/assert_nil_tests.rb +35 -38
  54. data/test/unit/assertions/assert_raises_tests.rb +58 -62
  55. data/test/unit/assertions/assert_respond_to_tests.rb +41 -42
  56. data/test/unit/assertions/assert_same_tests.rb +94 -90
  57. data/test/unit/assertions/assert_true_false_tests.rb +67 -69
  58. data/test/unit/assertions_tests.rb +17 -19
  59. data/test/unit/config_helpers_tests.rb +41 -43
  60. data/test/unit/config_tests.rb +42 -46
  61. data/test/unit/context/let_dsl_tests.rb +10 -0
  62. data/test/unit/context/setup_dsl_tests.rb +72 -91
  63. data/test/unit/context/subject_dsl_tests.rb +18 -51
  64. data/test/unit/context/suite_dsl_tests.rb +19 -23
  65. data/test/unit/context/test_dsl_tests.rb +52 -59
  66. data/test/unit/context_info_tests.rb +19 -21
  67. data/test/unit/context_tests.rb +175 -178
  68. data/test/unit/default_runner_tests.rb +4 -10
  69. data/test/unit/default_suite_tests.rb +54 -59
  70. data/test/unit/factory_tests.rb +6 -9
  71. data/test/unit/file_line_tests.rb +34 -40
  72. data/test/unit/macro_tests.rb +11 -20
  73. data/test/unit/result_tests.rb +156 -182
  74. data/test/unit/runner_tests.rb +72 -79
  75. data/test/unit/suite_tests.rb +62 -63
  76. data/test/unit/test_tests.rb +143 -147
  77. data/test/unit/utils_tests.rb +49 -62
  78. data/test/unit/view_helpers_tests.rb +67 -70
  79. data/test/unit/view_tests.rb +26 -32
  80. metadata +54 -47
  81. data/.assert.rb +0 -3
  82. data/.gitignore +0 -19
@@ -1,97 +1,93 @@
1
- require 'assert'
2
- require 'assert/assertions'
1
+ require "assert"
2
+ require "assert/assertions"
3
3
 
4
4
  module Assert::Assertions
5
-
6
5
  class AssertRaisesTests < Assert::Context
7
6
  include Assert::Test::TestHelpers
8
7
 
9
8
  desc "`assert_raises`"
10
- setup do
11
- d = @d = "assert raises fail desc"
12
- @test = Factory.test do
13
- assert_raises(StandardError, RuntimeError){ raise(StandardError) } # pass
14
- assert_raises(StandardError, RuntimeError, d){ raise(Exception) } # fail
15
- assert_raises(RuntimeError, d){ raise(StandardError) } # fail
16
- assert_raises(RuntimeError, d){ true } # fail
17
- assert_raises(d){ true } # fail
9
+ subject { test1 }
10
+
11
+ let(:desc1) { "assert raises fail desc" }
12
+ let(:test1) {
13
+ desc = desc1
14
+ Factory.test do
15
+ assert_raises(StandardError, RuntimeError) { raise(StandardError) } # pass
16
+ assert_raises(StandardError, RuntimeError, desc) { raise(Exception) } # fail
17
+ assert_raises(RuntimeError, desc) { raise(StandardError) } # fail
18
+ assert_raises(RuntimeError, desc) { true } # fail
19
+ assert_raises(desc) { true } # fail
18
20
  end
19
- @test.run(&test_run_callback)
20
- end
21
- subject{ @test }
21
+ }
22
22
 
23
23
  should "produce results as expected" do
24
- assert_equal 5, test_run_result_count
25
- assert_equal 1, test_run_result_count(:pass)
26
- assert_equal 4, test_run_result_count(:fail)
27
- end
28
-
29
- should "have a fail message with custom and generic explanations" do
30
- exp = [
31
- "#{@d}\nStandardError or RuntimeError exception expected, not:",
32
- "#{@d}\nRuntimeError exception expected, not:",
33
- "#{@d}\nRuntimeError exception expected but nothing raised.",
34
- "#{@d}\nAn exception expected but nothing raised."
35
- ]
24
+ subject.run(&test_run_callback)
25
+
26
+ assert_that(test_run_result_count).equals(5)
27
+ assert_that(test_run_result_count(:pass)).equals(1)
28
+ assert_that(test_run_result_count(:fail)).equals(4)
29
+
30
+ exp =
31
+ [ "#{desc1}\nStandardError or RuntimeError exception expected, not:",
32
+ "#{desc1}\nRuntimeError exception expected, not:",
33
+ "#{desc1}\nRuntimeError exception expected but nothing raised.",
34
+ "#{desc1}\nAn exception expected but nothing raised."
35
+ ]
36
36
  messages = test_run_results(:fail).map(&:message)
37
- messages.each_with_index{ |msg, n| assert_match /^#{exp[n]}/, msg }
37
+ messages.each_with_index{ |msg, n| assert_that(msg).matches(/^#{exp[n]}/) }
38
38
  end
39
39
 
40
40
  should "return any raised exception instance" do
41
41
  error = nil
42
42
  error_msg = Factory.string
43
- test = Factory.test do
44
- error = assert_raises(RuntimeError){ raise(RuntimeError, error_msg) }
45
- end
43
+
44
+ test =
45
+ Factory.test do
46
+ error = assert_raises(RuntimeError) { raise(RuntimeError, error_msg) }
47
+ end
46
48
  test.run
47
49
 
48
- assert_not_nil error
49
- assert_kind_of RuntimeError, error
50
- assert_equal error_msg, error.message
50
+ assert_that(error).is_not_nil
51
+ assert_that(error).is_kind_of(RuntimeError)
52
+ assert_that(error.message).equals(error_msg)
51
53
 
52
- test = Factory.test do
53
- error = assert_raises(RuntimeError){ }
54
- end
54
+ test = Factory.test { error = assert_raises(RuntimeError) {} }
55
55
  test.run
56
56
 
57
- assert_nil error
57
+ assert_that(error).is_nil
58
58
  end
59
-
60
59
  end
61
60
 
62
61
  class AssertNothingRaisedTests < Assert::Context
63
62
  include Assert::Test::TestHelpers
64
63
 
65
64
  desc "`assert_nothing_raised`"
66
- setup do
67
- d = @d = "assert nothing raised fail desc"
68
- @test = Factory.test do
69
- anr = :assert_nothing_raised
70
- self.send(anr, StandardError, RuntimeError, d){ raise(StandardError) } # fail
71
- self.send(anr, RuntimeError){ raise(StandardError) } # pass
72
- self.send(anr, d){ raise(RuntimeError) } # fail
73
- self.send(anr){ true } # pass
65
+ subject { test1 }
66
+
67
+ let(:desc1) { "assert nothing raised fail desc" }
68
+ let(:test1) {
69
+ desc = desc1
70
+ Factory.test do
71
+ assert_nothing_raised(StandardError, RuntimeError, desc) { raise(StandardError) } # fail
72
+ assert_nothing_raised(RuntimeError) { raise(StandardError) } # pass
73
+ assert_nothing_raised(desc) { raise(RuntimeError) } # fail
74
+ assert_nothing_raised { true } # pass
74
75
  end
75
- @test.run(&test_run_callback)
76
- end
77
- subject{ @test }
76
+ }
78
77
 
79
78
  should "produce results as expected" do
80
- assert_equal 4, test_run_result_count
81
- assert_equal 2, test_run_result_count(:pass)
82
- assert_equal 2, test_run_result_count(:fail)
83
- end
79
+ subject.run(&test_run_callback)
80
+
81
+ assert_that(test_run_result_count).equals(4)
82
+ assert_that(test_run_result_count(:pass)).equals(2)
83
+ assert_that(test_run_result_count(:fail)).equals(2)
84
84
 
85
- should "have a fail message with custom and generic explanations" do
86
- exp = [
87
- "#{@d}\nStandardError or RuntimeError exception not expected, but raised:",
88
- "#{@d}\nAn exception not expected, but raised:"
89
- ]
85
+ exp =
86
+ [ "#{desc1}\nStandardError or RuntimeError exception not expected, but raised:",
87
+ "#{desc1}\nAn exception not expected, but raised:"
88
+ ]
90
89
  messages = test_run_results(:fail).map(&:message)
91
- messages.each_with_index{ |msg, n| assert_match /^#{exp[n]}/, msg }
90
+ messages.each_with_index{ |msg, n| assert_that(msg).matches(/^#{exp[n]}/) }
92
91
  end
93
-
94
92
  end
95
-
96
93
  end
97
-
@@ -1,71 +1,70 @@
1
- require 'assert'
2
- require 'assert/assertions'
1
+ require "assert"
2
+ require "assert/assertions"
3
3
 
4
- require 'assert/utils'
4
+ require "assert/utils"
5
5
 
6
6
  module Assert::Assertions
7
-
8
7
  class AssertRespondToTests < Assert::Context
9
8
  include Assert::Test::TestHelpers
10
9
 
11
10
  desc "`assert_respond_to`"
12
- setup do
13
- desc = @desc = "assert respond to fail desc"
14
- args = @args = [ :abs, "1", desc ]
15
- @test = Factory.test do
11
+ subject { test1 }
12
+
13
+ let(:desc1) { "assert respond to fail desc" }
14
+ let(:args1) { [:abs, "1", desc1] }
15
+ let(:test1) {
16
+ args = args1
17
+ Factory.test do
16
18
  assert_respond_to(:abs, 1) # pass
17
19
  assert_respond_to(*args) # fail
18
20
  end
19
- @c = @test.config
20
- @test.run(&test_run_callback)
21
- end
22
- subject{ @test }
21
+ }
22
+ let(:config1) { test1.config }
23
23
 
24
24
  should "produce results as expected" do
25
- assert_equal 2, test_run_result_count
26
- assert_equal 1, test_run_result_count(:pass)
27
- assert_equal 1, test_run_result_count(:fail)
28
- end
25
+ subject.run(&test_run_callback)
29
26
 
30
- should "have a fail message with custom and generic explanations" do
31
- exp = "#{@args[2]}\n"\
32
- "Expected #{Assert::U.show(@args[1], @c)} (#{@args[1].class})"\
33
- " to respond to `#{@args[0]}`."
34
- assert_equal exp, test_run_results(:fail).first.message
35
- end
27
+ assert_that(test_run_result_count).equals(2)
28
+ assert_that(test_run_result_count(:pass)).equals(1)
29
+ assert_that(test_run_result_count(:fail)).equals(1)
36
30
 
31
+ exp =
32
+ "#{args1[2]}\n"\
33
+ "Expected #{Assert::U.show(args1[1], config1)} (#{args1[1].class})"\
34
+ " to respond to `#{args1[0]}`."
35
+ assert_that(test_run_results(:fail).first.message).equals(exp)
36
+ end
37
37
  end
38
38
 
39
39
  class AssertNotRespondToTests < Assert::Context
40
40
  include Assert::Test::TestHelpers
41
41
 
42
42
  desc "`assert_not_respond_to`"
43
- setup do
44
- desc = @desc = "assert not respond to fail desc"
45
- args = @args = [ :abs, 1, desc ]
46
- @test = Factory.test do
43
+ subject { test1 }
44
+
45
+ let(:desc1) { "assert not respond to fail desc" }
46
+ let(:args1) { [:abs, 1, desc1] }
47
+ let(:test1) {
48
+ args = args1
49
+ Factory.test do
47
50
  assert_not_respond_to(*args) # fail
48
51
  assert_not_respond_to(:abs, "1") # pass
49
52
  end
50
- @c = @test.config
51
- @test.run(&test_run_callback)
52
- end
53
- subject{ @test }
53
+ }
54
+ let(:config1) { test1.config }
54
55
 
55
56
  should "produce results as expected" do
56
- assert_equal 2, test_run_result_count
57
- assert_equal 1, test_run_result_count(:pass)
58
- assert_equal 1, test_run_result_count(:fail)
59
- end
57
+ subject.run(&test_run_callback)
60
58
 
61
- should "have a fail message with custom and generic explanations" do
62
- exp = "#{@args[2]}\n"\
63
- "Expected #{Assert::U.show(@args[1], @c)} (#{@args[1].class})"\
64
- " to not respond to `#{@args[0]}`."
65
- assert_equal exp, test_run_results(:fail).first.message
66
- end
59
+ assert_that(test_run_result_count).equals(2)
60
+ assert_that(test_run_result_count(:pass)).equals(1)
61
+ assert_that(test_run_result_count(:fail)).equals(1)
67
62
 
63
+ exp =
64
+ "#{args1[2]}\n"\
65
+ "Expected #{Assert::U.show(args1[1], config1)} (#{args1[1].class})"\
66
+ " to not respond to `#{args1[0]}`."
67
+ assert_that(test_run_results(:fail).first.message).equals(exp)
68
+ end
68
69
  end
69
-
70
70
  end
71
-
@@ -1,142 +1,146 @@
1
- require 'assert'
2
- require 'assert/assertions'
1
+ require "assert"
2
+ require "assert/assertions"
3
3
 
4
- require 'assert/utils'
4
+ require "assert/utils"
5
5
 
6
6
  module Assert::Assertions
7
-
8
7
  class AssertSameTests < Assert::Context
9
8
  include Assert::Test::TestHelpers
10
9
 
11
10
  desc "`assert_same`"
12
- setup do
13
- klass = Class.new; object = klass.new
14
- desc = @desc = "assert same fail desc"
15
- args = @args = [ object, klass.new, desc ]
16
- @test = Factory.test do
11
+ subject { test1 }
12
+
13
+ let(:class1) { Class.new }
14
+ let(:object1) { class1.new }
15
+ let(:desc1) { "assert same fail desc" }
16
+ let(:args1) { [object1, class1.new, desc1] }
17
+ let(:test1) {
18
+ args = args1
19
+ object = object1
20
+ Factory.test do
17
21
  assert_same(object, object) # pass
18
22
  assert_same(*args) # fail
19
23
  end
20
- @c = @test.config
21
- @test.run(&test_run_callback)
22
- end
23
- subject{ @test }
24
+ }
25
+ let(:config1) { test1.config }
24
26
 
25
27
  should "produce results as expected" do
26
- assert_equal 2, test_run_result_count
27
- assert_equal 1, test_run_result_count(:pass)
28
- assert_equal 1, test_run_result_count(:fail)
28
+ subject.run(&test_run_callback)
29
+
30
+ assert_that(test_run_result_count).equals(2)
31
+ assert_that(test_run_result_count(:pass)).equals(1)
32
+ assert_that(test_run_result_count(:fail)).equals(1)
33
+
34
+ exp =
35
+ "#{args1[2]}\n"\
36
+ "Expected #{Assert::U.show(args1[1], config1)}"\
37
+ " (#<#{args1[1].class}:#{"0x0%x" % (args1[1].object_id << 1)}>)"\
38
+ " to be the same as #{Assert::U.show(args1[0], config1)}"\
39
+ " (#<#{args1[0].class}:#{"0x0%x" % (args1[0].object_id << 1)}>)."
40
+ assert_that(test_run_results(:fail).first.message).equals(exp)
29
41
  end
30
-
31
- should "have a fail message with custom and generic explanations" do
32
- exp = "#{@args[2]}\n"\
33
- "Expected #{Assert::U.show(@args[1], @c)}"\
34
- " (#<#{@args[1].class}:#{'0x0%x' % (@args[1].object_id << 1)}>)"\
35
- " to be the same as #{Assert::U.show(@args[0], @c)}"\
36
- " (#<#{@args[0].class}:#{'0x0%x' % (@args[0].object_id << 1)}>)."
37
- assert_equal exp, test_run_results(:fail).first.message
38
- end
39
-
40
42
  end
41
43
 
42
44
  class AssertNotSameTests < Assert::Context
43
45
  include Assert::Test::TestHelpers
44
46
 
45
47
  desc "`assert_not_same`"
46
- setup do
47
- klass = Class.new; object = klass.new
48
- desc = @desc = "assert not same fail desc"
49
- args = @args = [ object, object, desc ]
50
- @test = Factory.test do
48
+ subject { test1 }
49
+
50
+ let(:class1) { Class.new }
51
+ let(:object1) { class1.new }
52
+ let(:desc1) { "assert not same fail desc" }
53
+ let(:args1) { [object1, object1, desc1] }
54
+ let(:test1) {
55
+ args = args1
56
+ object = object1
57
+ klass = class1
58
+ Factory.test do
51
59
  assert_not_same(*args) # fail
52
60
  assert_not_same(object, klass.new) # pass
53
61
  end
54
- @c = @test.config
55
- @test.run(&test_run_callback)
56
- end
57
- subject{ @test }
62
+ }
63
+ let(:config1) { test1.config }
58
64
 
59
65
  should "produce results as expected" do
60
- assert_equal 2, test_run_result_count
61
- assert_equal 1, test_run_result_count(:pass)
62
- assert_equal 1, test_run_result_count(:fail)
63
- end
64
-
65
- should "have a fail message with custom and generic explanations" do
66
- exp = "#{@args[2]}\n"\
67
- "Expected #{Assert::U.show(@args[1], @c)}"\
68
- " (#<#{@args[1].class}:#{'0x0%x' % (@args[1].object_id << 1)}>)"\
69
- " to not be the same as #{Assert::U.show(@args[0], @c)}"\
70
- " (#<#{@args[0].class}:#{'0x0%x' % (@args[0].object_id << 1)}>)."
71
- assert_equal exp, test_run_results(:fail).first.message
66
+ subject.run(&test_run_callback)
67
+
68
+ assert_that(test_run_result_count).equals(2)
69
+ assert_that(test_run_result_count(:pass)).equals(1)
70
+ assert_that(test_run_result_count(:fail)).equals(1)
71
+
72
+ exp =
73
+ "#{args1[2]}\n"\
74
+ "Expected #{Assert::U.show(args1[1], config1)}"\
75
+ " (#<#{args1[1].class}:#{"0x0%x" % (args1[1].object_id << 1)}>)"\
76
+ " to not be the same as #{Assert::U.show(args1[0], config1)}"\
77
+ " (#<#{args1[0].class}:#{"0x0%x" % (args1[0].object_id << 1)}>)."
78
+ assert_that(test_run_results(:fail).first.message).equals(exp)
72
79
  end
73
-
74
80
  end
75
81
 
76
82
  class DiffTests < Assert::Context
77
83
  include Assert::Test::TestHelpers
78
84
 
79
85
  desc "with objects that should use diff when showing"
80
- setup do
81
- @exp_obj = "I'm a\nstring"
82
- @act_obj = "I am a \nstring"
83
-
84
- @c = Factory.modes_off_config
85
- @c.use_diff_proc(Assert::U.default_use_diff_proc)
86
- @c.run_diff_proc(Assert::U.syscmd_diff_proc)
87
-
88
- @exp_obj_show = Assert::U.show_for_diff(@exp_obj, @c)
89
- @act_obj_show = Assert::U.show_for_diff(@act_obj, @c)
90
- end
86
+ let(:config1) {
87
+ Factory.modes_off_config.tap do |config|
88
+ config.use_diff_proc(Assert::U.default_use_diff_proc)
89
+ config.run_diff_proc(Assert::U.syscmd_diff_proc)
90
+ end
91
+ }
91
92
 
93
+ let(:exp_obj1) { "I'm a\nstring" }
94
+ let(:act_obj1) { "I am a \nstring" }
95
+ let(:exp_obj_show1) { Assert::U.show_for_diff(exp_obj1, config1) }
96
+ let(:act_obj_show1) { Assert::U.show_for_diff(act_obj1, config1) }
92
97
  end
93
98
 
94
99
  class AssertSameDiffTests < DiffTests
95
100
  desc "`assert_same`"
96
- setup do
97
- exp_obj, act_obj = @exp_obj, @act_obj
98
- @test = Factory.test(@c) do
101
+ subject { test1 }
102
+
103
+ let(:test1) {
104
+ exp_obj, act_obj = exp_obj1, act_obj1
105
+ Factory.test(config1) do
99
106
  assert_same(exp_obj, act_obj)
100
107
  end
101
- @test.run(&test_run_callback)
102
- end
103
- subject{ @test }
108
+ }
104
109
 
105
110
  should "include diff output in the fail messages" do
106
- exp = "Expected #<#{@act_obj.class}:#{'0x0%x' % (@act_obj.object_id << 1)}>"\
107
- " to be the same as"\
108
- " #<#{@exp_obj.class}:#{'0x0%x' % (@exp_obj.object_id << 1)}>"\
109
- ", diff:\n"\
110
- "#{Assert::U.syscmd_diff_proc.call(@exp_obj_show, @act_obj_show)}"
111
- assert_equal exp, test_run_results(:fail).first.message
111
+ subject.run(&test_run_callback)
112
+
113
+ exp =
114
+ "Expected #<#{act_obj1.class}:#{"0x0%x" % (act_obj1.object_id << 1)}>"\
115
+ " to be the same as"\
116
+ " #<#{exp_obj1.class}:#{"0x0%x" % (exp_obj1.object_id << 1)}>"\
117
+ ", diff:\n"\
118
+ "#{Assert::U.syscmd_diff_proc.call(exp_obj_show1, act_obj_show1)}"
119
+ assert_that(test_run_results(:fail).first.message).equals(exp)
112
120
  end
113
-
114
121
  end
115
122
 
116
123
  class AssertNotSameDiffTests < DiffTests
117
124
  desc "`assert_not_same`"
118
- setup do
119
- @exp_obj = @act_obj
120
- @exp_obj_show = @act_obj_show
125
+ subject { test1 }
121
126
 
122
- exp_obj, act_obj = @exp_obj, @act_obj
123
- @test = Factory.test(@c) do
124
- assert_not_same(exp_obj, exp_obj)
127
+ let(:test1) {
128
+ act_obj = act_obj1
129
+ Factory.test(config1) do
130
+ assert_not_same(act_obj, act_obj)
125
131
  end
126
- @test.run(&test_run_callback)
127
- end
128
- subject{ @test }
132
+ }
129
133
 
130
134
  should "include diff output in the fail messages" do
131
- exp = "Expected #<#{@act_obj.class}:#{'0x0%x' % (@act_obj.object_id << 1)}>"\
132
- " to not be the same as"\
133
- " #<#{@exp_obj.class}:#{'0x0%x' % (@exp_obj.object_id << 1)}>"\
134
- ", diff:\n"\
135
- "#{Assert::U.syscmd_diff_proc.call(@exp_obj_show, @act_obj_show)}"
136
- assert_equal exp, test_run_results(:fail).first.message
135
+ subject.run(&test_run_callback)
136
+
137
+ exp =
138
+ "Expected #<#{act_obj1.class}:#{"0x0%x" % (act_obj1.object_id << 1)}>"\
139
+ " to not be the same as"\
140
+ " #<#{act_obj1.class}:#{"0x0%x" % (act_obj1.object_id << 1)}>"\
141
+ ", diff:\n"\
142
+ "#{Assert::U.syscmd_diff_proc.call(act_obj_show1, act_obj_show1)}"
143
+ assert_that(test_run_results(:fail).first.message).equals(exp)
137
144
  end
138
-
139
145
  end
140
-
141
146
  end
142
-