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