assert 2.18.2 → 2.19.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -2
  3. data/README.md +7 -6
  4. data/assert.gemspec +5 -2
  5. data/bin/assert +1 -0
  6. data/lib/assert.rb +2 -0
  7. data/lib/assert/actual_value.rb +143 -0
  8. data/lib/assert/assert_runner.rb +2 -0
  9. data/lib/assert/assertions.rb +82 -20
  10. data/lib/assert/cli.rb +2 -0
  11. data/lib/assert/config.rb +2 -0
  12. data/lib/assert/config_helpers.rb +2 -0
  13. data/lib/assert/context.rb +33 -37
  14. data/lib/assert/context/let_dsl.rb +16 -0
  15. data/lib/assert/context/method_missing.rb +22 -0
  16. data/lib/assert/context/setup_dsl.rb +3 -0
  17. data/lib/assert/context/subject_dsl.rb +26 -24
  18. data/lib/assert/context/suite_dsl.rb +3 -0
  19. data/lib/assert/context/test_dsl.rb +3 -0
  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 +2 -0
  23. data/lib/assert/default_view.rb +2 -0
  24. data/lib/assert/factory.rb +2 -0
  25. data/lib/assert/file_line.rb +2 -0
  26. data/lib/assert/macro.rb +2 -0
  27. data/lib/assert/macros/methods.rb +6 -4
  28. data/lib/assert/result.rb +8 -1
  29. data/lib/assert/runner.rb +2 -0
  30. data/lib/assert/stub.rb +45 -0
  31. data/lib/assert/suite.rb +9 -10
  32. data/lib/assert/test.rb +3 -9
  33. data/lib/assert/utils.rb +3 -1
  34. data/lib/assert/version.rb +3 -1
  35. data/lib/assert/view.rb +2 -0
  36. data/lib/assert/view_helpers.rb +2 -0
  37. data/test/helper.rb +28 -28
  38. data/test/support/factory.rb +17 -0
  39. data/test/support/inherited_stuff.rb +2 -0
  40. data/test/system/stub_tests.rb +334 -333
  41. data/test/system/test_tests.rb +101 -109
  42. data/test/unit/actual_value_tests.rb +373 -0
  43. data/test/unit/assert_tests.rb +79 -61
  44. data/test/unit/assertions/assert_block_tests.rb +32 -31
  45. data/test/unit/assertions/assert_changes_tests.rb +99 -0
  46. data/test/unit/assertions/assert_empty_tests.rb +35 -32
  47. data/test/unit/assertions/assert_equal_tests.rb +96 -74
  48. data/test/unit/assertions/assert_file_exists_tests.rb +34 -33
  49. data/test/unit/assertions/assert_includes_tests.rb +40 -37
  50. data/test/unit/assertions/assert_instance_of_tests.rb +36 -33
  51. data/test/unit/assertions/assert_kind_of_tests.rb +36 -33
  52. data/test/unit/assertions/assert_match_tests.rb +36 -33
  53. data/test/unit/assertions/assert_nil_tests.rb +32 -31
  54. data/test/unit/assertions/assert_raises_tests.rb +57 -55
  55. data/test/unit/assertions/assert_respond_to_tests.rb +38 -35
  56. data/test/unit/assertions/assert_same_tests.rb +88 -81
  57. data/test/unit/assertions/assert_true_false_tests.rb +62 -60
  58. data/test/unit/assertions_tests.rb +28 -24
  59. data/test/unit/config_helpers_tests.rb +45 -38
  60. data/test/unit/config_tests.rb +40 -34
  61. data/test/unit/context/let_dsl_tests.rb +12 -0
  62. data/test/unit/context/setup_dsl_tests.rb +72 -81
  63. data/test/unit/context/subject_dsl_tests.rb +17 -43
  64. data/test/unit/context/suite_dsl_tests.rb +17 -16
  65. data/test/unit/context/test_dsl_tests.rb +52 -52
  66. data/test/unit/context_info_tests.rb +25 -15
  67. data/test/unit/context_tests.rb +186 -179
  68. data/test/unit/default_runner_tests.rb +4 -5
  69. data/test/unit/default_suite_tests.rb +59 -53
  70. data/test/unit/factory_tests.rb +7 -3
  71. data/test/unit/file_line_tests.rb +35 -35
  72. data/test/unit/macro_tests.rb +16 -10
  73. data/test/unit/result_tests.rb +161 -183
  74. data/test/unit/runner_tests.rb +67 -65
  75. data/test/unit/suite_tests.rb +58 -59
  76. data/test/unit/test_tests.rb +120 -139
  77. data/test/unit/utils_tests.rb +45 -45
  78. data/test/unit/view_helpers_tests.rb +56 -52
  79. data/test/unit/view_tests.rb +24 -23
  80. metadata +29 -6
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/assertions"
3
5
 
@@ -8,28 +10,29 @@ module Assert::Assertions
8
10
  include Assert::Test::TestHelpers
9
11
 
10
12
  desc "`assert_equal`"
11
- setup do
12
- desc = @desc = "assert equal fail desc"
13
- a = @a = ["1", "2", desc]
14
- @test = Factory.test do
15
- assert_equal(1, 1) # pass
16
- assert_equal(*a) # fail
13
+ subject {
14
+ args = args1
15
+ Factory.test do
16
+ assert_equal(1, 1) # pass
17
+ assert_equal(*args) # fail
17
18
  end
18
- @c = @test.config
19
- @test.run(&test_run_callback)
20
- end
21
- subject{ @test }
19
+ }
20
+
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
- assert_equal 2, test_run_result_count
25
- assert_equal 1, test_run_result_count(:pass)
26
- assert_equal 1, test_run_result_count(:fail)
27
- end
26
+ subject.run(&test_run_callback)
27
+
28
+ assert_that(test_run_result_count).equals(2)
29
+ assert_that(test_run_result_count(:pass)).equals(1)
30
+ assert_that(test_run_result_count(:fail)).equals(1)
28
31
 
29
- should "have a fail message with custom and generic explanations" do
30
- exp = "#{@a[2]}\nExpected #{Assert::U.show(@a[1], @c)}"\
31
- " to be equal to #{Assert::U.show(@a[0], @c)}."
32
- assert_equal exp, test_run_results(:fail).first.message
32
+ exp =
33
+ "#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)}"\
34
+ " to be equal to #{Assert::U.show(args1[0], config1)}."
35
+ assert_that(test_run_results(:fail).first.message).equals(exp)
33
36
  end
34
37
  end
35
38
 
@@ -37,28 +40,29 @@ module Assert::Assertions
37
40
  include Assert::Test::TestHelpers
38
41
 
39
42
  desc "`assert_not_equal`"
40
- setup do
41
- desc = @desc = "assert not equal fail desc"
42
- a = @a = ["1", "1", desc]
43
- @test = Factory.test do
44
- assert_not_equal(*a) # fail
45
- assert_not_equal(1, 2) # pass
43
+ subject {
44
+ args = args1
45
+ Factory.test do
46
+ assert_not_equal(*args) # fail
47
+ assert_not_equal(1, 2) # pass
46
48
  end
47
- @c = @test.config
48
- @test.run(&test_run_callback)
49
- end
50
- subject{ @test }
49
+ }
50
+
51
+ let(:desc1) { "assert not equal fail desc" }
52
+ let(:args1) { ["1", "1", desc1] }
53
+ let(:config1) { subject.config }
51
54
 
52
55
  should "produce results as expected" do
53
- assert_equal 2, test_run_result_count
54
- assert_equal 1, test_run_result_count(:pass)
55
- assert_equal 1, test_run_result_count(:fail)
56
- end
56
+ subject.run(&test_run_callback)
57
57
 
58
- should "have a fail message with custom and generic explanations" do
59
- exp = "#{@a[2]}\nExpected #{Assert::U.show(@a[1], @c)}"\
60
- " to not be equal to #{Assert::U.show(@a[0], @c)}."
61
- assert_equal exp, test_run_results(:fail).first.message
58
+ assert_that(test_run_result_count).equals(2)
59
+ assert_that(test_run_result_count(:pass)).equals(1)
60
+ assert_that(test_run_result_count(:fail)).equals(1)
61
+
62
+ exp =
63
+ "#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)}"\
64
+ " to not be equal to #{Assert::U.show(args1[0], config1)}."
65
+ assert_that(test_run_results(:fail).first.message).equals(exp)
62
66
  end
63
67
  end
64
68
 
@@ -66,21 +70,36 @@ module Assert::Assertions
66
70
  include Assert::Test::TestHelpers
67
71
 
68
72
  desc "with objects that define custom equality operators"
69
- setup do
70
- is_class = Class.new do
71
- def ==(other); true; end
72
- end
73
- @is = is_class.new
74
73
 
75
- is_not_class = Class.new do
76
- def ==(other); false; end
74
+ let(:is_class) {
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
77
83
  end
78
- @is_not = is_not_class.new
79
- end
84
+ }
85
+ let(:is_not_class) {
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
+ }
96
+
97
+ let(:is1) { is_class.new }
98
+ let(:is_not1) { is_not_class.new }
80
99
 
81
100
  should "use the equality operator of the exp value" do
82
- assert_equal @is, @is_not
83
- assert_not_equal @is_not, @is
101
+ assert_that(is1).equals(is_not1)
102
+ assert_that(is_not1).does_not_equal(is1)
84
103
  end
85
104
  end
86
105
 
@@ -88,52 +107,55 @@ module Assert::Assertions
88
107
  include Assert::Test::TestHelpers
89
108
 
90
109
  desc "with objects that should use diff when showing"
91
- setup do
92
- @exp_obj = "I'm a\nstring"
93
- @act_obj = "I am a \nstring"
94
110
 
95
- @c = Factory.modes_off_config
96
- @c.use_diff_proc(Assert::U.default_use_diff_proc)
97
- @c.run_diff_proc(Assert::U.syscmd_diff_proc)
111
+ let(:config1) {
112
+ Factory.modes_off_config.tap do |config|
113
+ config.use_diff_proc(Assert::U.default_use_diff_proc)
114
+ config.run_diff_proc(Assert::U.syscmd_diff_proc)
115
+ end
116
+ }
98
117
 
99
- @exp_obj_show = Assert::U.show_for_diff(@exp_obj, @c)
100
- @act_obj_show = Assert::U.show_for_diff(@act_obj, @c)
101
- end
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) }
102
122
  end
103
123
 
104
124
  class AssertEqualDiffTests < DiffTests
105
125
  desc "`assert_equal`"
106
- setup do
107
- exp_obj, act_obj = @exp_obj, @act_obj
108
- @test = Factory.test(@c) do
126
+ subject {
127
+ exp_obj, act_obj = exp_obj1, act_obj1
128
+ Factory.test(config1) do
109
129
  assert_equal(exp_obj, act_obj)
110
130
  end
111
- @test.run(&test_run_callback)
112
- end
113
- subject{ @test }
131
+ }
114
132
 
115
133
  should "include diff output in the fail messages" do
116
- exp = "Expected does not equal actual, diff:\n"\
117
- "#{Assert::U.syscmd_diff_proc.call(@exp_obj_show, @act_obj_show)}"
118
- assert_equal exp, test_run_results(:fail).first.message
134
+ subject.run(&test_run_callback)
135
+
136
+ exp =
137
+ "Expected does not equal actual, diff:\n"\
138
+ "#{Assert::U.syscmd_diff_proc.call(exp_obj_show1, act_obj_show1)}"
139
+ assert_that(test_run_results(:fail).first.message).equals(exp)
119
140
  end
120
141
  end
121
142
 
122
143
  class AssertNotEqualDiffTests < DiffTests
123
144
  desc "`assert_not_equal`"
124
- setup do
125
- exp_obj, act_obj = @exp_obj, @act_obj
126
- @test = Factory.test(@c) do
145
+ subject {
146
+ exp_obj = exp_obj1
147
+ Factory.test(config1) do
127
148
  assert_not_equal(exp_obj, exp_obj)
128
149
  end
129
- @test.run(&test_run_callback)
130
- end
131
- subject{ @test }
150
+ }
132
151
 
133
152
  should "include diff output in the fail messages" do
134
- exp = "Expected equals actual, diff:\n"\
135
- "#{Assert::U.syscmd_diff_proc.call(@exp_obj_show, @exp_obj_show)}"
136
- assert_equal exp, test_run_results(:fail).first.message
153
+ subject.run(&test_run_callback)
154
+
155
+ exp =
156
+ "Expected equals actual, diff:\n"\
157
+ "#{Assert::U.syscmd_diff_proc.call(exp_obj_show1, exp_obj_show1)}"
158
+ assert_that(test_run_results(:fail).first.message).equals(exp)
137
159
  end
138
160
  end
139
161
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/assertions"
3
5
 
@@ -9,27 +11,27 @@ module Assert::Assertions
9
11
  include Assert::Test::TestHelpers
10
12
 
11
13
  desc "`assert_file_exists`"
12
- setup do
13
- desc = @desc = "assert file exists empty fail desc"
14
- args = @args = ["/a/path/to/some/file/that/no/exists", desc]
15
- @test = Factory.test do
14
+ subject {
15
+ args = args1
16
+ Factory.test do
16
17
  assert_file_exists(__FILE__) # pass
17
18
  assert_file_exists(*args) # fail
18
19
  end
19
- @c = @test.config
20
- @test.run(&test_run_callback)
21
- end
22
- subject{ @test }
20
+ }
21
+
22
+ let(:desc1) { "assert file exists fail desc" }
23
+ let(:args1) { ["/a/path/to/some/file/that/no/exists", desc1] }
24
+ let(:config1) { subject.config }
23
25
 
24
26
  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
27
+ subject.run(&test_run_callback)
28
+
29
+ assert_that(test_run_result_count).equals(2)
30
+ assert_that(test_run_result_count(:pass)).equals(1)
31
+ assert_that(test_run_result_count(:fail)).equals(1)
29
32
 
30
- should "have a fail message with custom and generic explanations" do
31
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to exist."
32
- assert_equal exp, test_run_results(:fail).first.message
33
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to exist."
34
+ assert_that(test_run_results(:fail).first.message).equals(exp)
33
35
  end
34
36
  end
35
37
 
@@ -37,28 +39,27 @@ module Assert::Assertions
37
39
  include Assert::Test::TestHelpers
38
40
 
39
41
  desc "`assert_not_file_exists`"
40
- setup do
41
- desc = @desc = "assert not file exists empty fail desc"
42
- args = @args = [__FILE__, desc]
43
- @test = Factory.test do
44
- assert_not_file_exists("/a/path/to/some/file/that/no/exists") # pass
45
- assert_not_file_exists(*args) # fail
42
+ subject {
43
+ args = args1
44
+ Factory.test do
45
+ assert_not_file_exists("/file/path") # pass
46
+ assert_not_file_exists(*args) # fail
46
47
  end
47
- @c = @test.config
48
- @test.run(&test_run_callback)
49
- end
50
- subject{ @test }
48
+ }
49
+
50
+ let(:desc1) { "assert not file exists fail desc" }
51
+ let(:args1) { [__FILE__, desc1] }
52
+ let(:config1) { subject.config }
51
53
 
52
54
  should "produce results as expected" do
53
- assert_equal 2, test_run_result_count
54
- assert_equal 1, test_run_result_count(:pass)
55
- assert_equal 1, test_run_result_count(:fail)
56
- end
55
+ subject.run(&test_run_callback)
57
56
 
58
- should "have a fail message with custom and generic explanations" do
59
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to not exist."
60
- assert_equal exp, test_run_results(:fail).first.message
57
+ assert_that(test_run_result_count).equals(2)
58
+ assert_that(test_run_result_count(:pass)).equals(1)
59
+ assert_that(test_run_result_count(:fail)).equals(1)
60
+
61
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not exist."
62
+ assert_that(test_run_results(:fail).first.message).equals(exp)
61
63
  end
62
64
  end
63
65
  end
64
-
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/assertions"
3
5
 
@@ -8,29 +10,30 @@ module Assert::Assertions
8
10
  include Assert::Test::TestHelpers
9
11
 
10
12
  desc "`assert_includes`"
11
- setup do
12
- desc = @desc = "assert includes fail desc"
13
- args = @args = [2, [1], desc]
14
- @test = Factory.test do
13
+ subject {
14
+ args = args1
15
+ Factory.test do
15
16
  assert_includes(1, [1]) # pass
16
- assert_includes(*args) # fail
17
+ assert_includes(*args) # fail
17
18
  end
18
- @c = @test.config
19
- @test.run(&test_run_callback)
20
- end
21
- subject{ @test }
19
+ }
20
+
21
+ let(:desc1) { "assert includes fail desc" }
22
+ let(:args1) { [2, [1], desc1] }
23
+ let(:config1) { subject.config }
22
24
 
23
25
  should "produce results as expected" do
24
- assert_equal 2, test_run_result_count
25
- assert_equal 1, test_run_result_count(:pass)
26
- assert_equal 1, test_run_result_count(:fail)
27
- end
26
+ subject.run(&test_run_callback)
27
+
28
+ assert_that(test_run_result_count).equals(2)
29
+ assert_that(test_run_result_count(:pass)).equals(1)
30
+ assert_that(test_run_result_count(:fail)).equals(1)
28
31
 
29
- should "have a fail message with custom and generic explanations" do
30
- exp = "#{@args[2]}\n"\
31
- "Expected #{Assert::U.show(@args[1], @c)}"\
32
- " to include #{Assert::U.show(@args[0], @c)}."
33
- assert_equal exp, test_run_results(:fail).first.message
32
+ exp =
33
+ "#{args1[2]}\n"\
34
+ "Expected #{Assert::U.show(args1[1], config1)}"\
35
+ " to include #{Assert::U.show(args1[0], config1)}."
36
+ assert_that(test_run_results(:fail).first.message).equals(exp)
34
37
  end
35
38
  end
36
39
 
@@ -38,30 +41,30 @@ module Assert::Assertions
38
41
  include Assert::Test::TestHelpers
39
42
 
40
43
  desc "`assert_not_included`"
41
- setup do
42
- desc = @desc = "assert not included fail desc"
43
- args = @args = [1, [1], desc]
44
- @test = Factory.test do
44
+ subject {
45
+ args = args1
46
+ Factory.test do
45
47
  assert_not_included(2, [1]) # pass
46
- assert_not_included(*args) # fail
48
+ assert_not_included(*args) # fail
47
49
  end
48
- @c = @test.config
49
- @test.run(&test_run_callback)
50
- end
51
- subject{ @test }
50
+ }
51
+
52
+ let(:desc1) { "assert not included fail desc" }
53
+ let(:args1) { [1, [1], desc1] }
54
+ let(:config1) { subject.config }
52
55
 
53
56
  should "produce results as expected" do
54
- assert_equal 2, test_run_result_count
55
- assert_equal 1, test_run_result_count(:pass)
56
- assert_equal 1, test_run_result_count(:fail)
57
- end
57
+ subject.run(&test_run_callback)
58
58
 
59
- should "have a fail message with custom and generic explanations" do
60
- exp = "#{@args[2]}\n"\
61
- "Expected #{Assert::U.show(@args[1], @c)}"\
62
- " to not include #{Assert::U.show(@args[0], @c)}."
63
- assert_equal exp, test_run_results(:fail).first.message
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)
62
+
63
+ exp =
64
+ "#{args1[2]}\n"\
65
+ "Expected #{Assert::U.show(args1[1], config1)}"\
66
+ " to not include #{Assert::U.show(args1[0], config1)}."
67
+ assert_that(test_run_results(:fail).first.message).equals(exp)
64
68
  end
65
69
  end
66
70
  end
67
-
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/assertions"
3
5
 
@@ -8,28 +10,29 @@ module Assert::Assertions
8
10
  include Assert::Test::TestHelpers
9
11
 
10
12
  desc "`assert_instance_of`"
11
- setup do
12
- desc = @desc = "assert instance of fail desc"
13
- args = @args = [Array, "object", desc]
14
- @test = Factory.test do
13
+ subject {
14
+ args = args1
15
+ Factory.test do
15
16
  assert_instance_of(String, "object") # pass
16
17
  assert_instance_of(*args) # fail
17
18
  end
18
- @c = @test.config
19
- @test.run(&test_run_callback)
20
- end
21
- subject{ @test }
19
+ }
20
+
21
+ let(:desc1) { "assert instance of fail desc" }
22
+ let(:args1) { [Array, "object", desc1] }
23
+ let(:config1) { subject.config }
22
24
 
23
25
  should "produce results as expected" do
24
- assert_equal 2, test_run_result_count
25
- assert_equal 1, test_run_result_count(:pass)
26
- assert_equal 1, test_run_result_count(:fail)
27
- end
26
+ subject.run(&test_run_callback)
27
+
28
+ assert_that(test_run_result_count).equals(2)
29
+ assert_that(test_run_result_count(:pass)).equals(1)
30
+ assert_that(test_run_result_count(:fail)).equals(1)
28
31
 
29
- should "have a fail message with custom and generic explanations" do
30
- exp = "#{@args[2]}\nExpected #{Assert::U.show(@args[1], @c)} (#{@args[1].class})"\
31
- " to be an instance of #{@args[0]}."
32
- assert_equal exp, test_run_results(:fail).first.message
32
+ exp =
33
+ "#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)} (#{args1[1].class})"\
34
+ " to be an instance of #{args1[0]}."
35
+ assert_that(test_run_results(:fail).first.message).equals(exp)
33
36
  end
34
37
  end
35
38
 
@@ -37,29 +40,29 @@ module Assert::Assertions
37
40
  include Assert::Test::TestHelpers
38
41
 
39
42
  desc "`assert_not_instance_of`"
40
- setup do
41
- desc = @desc = "assert not instance of fail desc"
42
- args = @args = [String, "object", desc]
43
- @test = Factory.test do
43
+ subject {
44
+ args = args1
45
+ Factory.test do
44
46
  assert_not_instance_of(*args) # fail
45
47
  assert_not_instance_of(Array, "object") # pass
46
48
  end
47
- @c = @test.config
48
- @test.run(&test_run_callback)
49
- end
50
- subject{ @test }
49
+ }
50
+
51
+ let(:desc1) { "assert not instance of fail desc" }
52
+ let(:args1) { [String, "object", desc1] }
53
+ let(:config1) { subject.config }
51
54
 
52
55
  should "produce results as expected" do
53
- assert_equal 2, test_run_result_count
54
- assert_equal 1, test_run_result_count(:pass)
55
- assert_equal 1, test_run_result_count(:fail)
56
- end
56
+ subject.run(&test_run_callback)
57
57
 
58
- should "have a fail message with custom and generic explanations" do
59
- exp = "#{@args[2]}\nExpected #{Assert::U.show(@args[1], @c)} (#{@args[1].class})"\
60
- " to not be an instance of #{@args[0]}."
61
- assert_equal exp, test_run_results(:fail).first.message
58
+ assert_that(test_run_result_count).equals(2)
59
+ assert_that(test_run_result_count(:pass)).equals(1)
60
+ assert_that(test_run_result_count(:fail)).equals(1)
61
+
62
+ exp =
63
+ "#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)} (#{args1[1].class})"\
64
+ " to not be an instance of #{args1[0]}."
65
+ assert_that(test_run_results(:fail).first.message).equals(exp)
62
66
  end
63
67
  end
64
68
  end
65
-