assert 2.18.3 → 2.19.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 +4 -4
- data/Gemfile +4 -2
- data/assert.gemspec +11 -5
- data/bin/assert +1 -0
- data/lib/assert.rb +20 -6
- data/lib/assert/actual_value.rb +26 -8
- data/lib/assert/assert_runner.rb +38 -17
- data/lib/assert/assertions.rb +145 -41
- data/lib/assert/cli.rb +19 -66
- data/lib/assert/clirb.rb +55 -0
- data/lib/assert/config.rb +9 -7
- data/lib/assert/config_helpers.rb +57 -22
- data/lib/assert/context.rb +33 -49
- data/lib/assert/context/let_dsl.rb +10 -4
- data/lib/assert/context/method_missing.rb +3 -0
- data/lib/assert/context/setup_dsl.rb +24 -16
- data/lib/assert/context/subject_dsl.rb +26 -25
- data/lib/assert/context/suite_dsl.rb +5 -1
- data/lib/assert/context/test_dsl.rb +58 -19
- data/lib/assert/context_info.rb +2 -0
- data/lib/assert/default_runner.rb +2 -0
- data/lib/assert/default_suite.rb +27 -15
- data/lib/assert/default_view.rb +49 -30
- data/lib/assert/factory.rb +2 -0
- data/lib/assert/file_line.rb +8 -6
- data/lib/assert/macro.rb +3 -1
- data/lib/assert/macros/methods.rb +73 -45
- data/lib/assert/result.rb +117 -61
- data/lib/assert/runner.rb +70 -51
- data/lib/assert/stub.rb +44 -3
- data/lib/assert/suite.rb +76 -38
- data/lib/assert/test.rb +43 -44
- data/lib/assert/utils.rb +22 -11
- data/lib/assert/version.rb +3 -1
- data/lib/assert/view.rb +46 -18
- data/lib/assert/view_helpers.rb +102 -92
- data/test/helper.rb +8 -4
- data/test/support/factory.rb +40 -21
- data/test/support/inherited_stuff.rb +2 -0
- data/test/system/stub_tests.rb +272 -250
- data/test/system/test_tests.rb +89 -73
- data/test/unit/actual_value_tests.rb +103 -46
- data/test/unit/assert_tests.rb +49 -39
- data/test/unit/assertions/assert_block_tests.rb +14 -14
- data/test/unit/assertions/assert_changes_tests.rb +103 -0
- data/test/unit/assertions/assert_empty_tests.rb +18 -16
- data/test/unit/assertions/assert_equal_tests.rb +48 -32
- data/test/unit/assertions/assert_file_exists_tests.rb +19 -17
- data/test/unit/assertions/assert_includes_tests.rb +14 -14
- data/test/unit/assertions/assert_instance_of_tests.rb +18 -18
- data/test/unit/assertions/assert_is_a_tests.rb +128 -0
- data/test/unit/assertions/assert_match_tests.rb +14 -14
- data/test/unit/assertions/assert_nil_tests.rb +20 -16
- data/test/unit/assertions/assert_raises_tests.rb +36 -27
- data/test/unit/assertions/assert_respond_to_tests.rb +14 -14
- data/test/unit/assertions/assert_same_tests.rb +28 -32
- data/test/unit/assertions/assert_true_false_tests.rb +38 -32
- data/test/unit/assertions_tests.rb +25 -18
- data/test/unit/config_helpers_tests.rb +20 -9
- data/test/unit/config_tests.rb +16 -8
- data/test/unit/context/let_dsl_tests.rb +2 -0
- data/test/unit/context/setup_dsl_tests.rb +27 -15
- data/test/unit/context/subject_dsl_tests.rb +5 -4
- data/test/unit/context/suite_dsl_tests.rb +6 -5
- data/test/unit/context/test_dsl_tests.rb +43 -19
- data/test/unit/context_info_tests.rb +12 -3
- data/test/unit/context_tests.rb +166 -116
- data/test/unit/default_runner_tests.rb +2 -0
- data/test/unit/default_suite_tests.rb +17 -5
- data/test/unit/factory_tests.rb +5 -1
- data/test/unit/file_line_tests.rb +14 -12
- data/test/unit/macro_tests.rb +17 -10
- data/test/unit/result_tests.rb +72 -75
- data/test/unit/runner_tests.rb +38 -23
- data/test/unit/suite_tests.rb +48 -30
- data/test/unit/test_tests.rb +88 -102
- data/test/unit/utils_tests.rb +53 -36
- data/test/unit/view_helpers_tests.rb +25 -17
- data/test/unit/view_tests.rb +8 -5
- metadata +40 -9
- data/test/unit/assertions/assert_kind_of_tests.rb +0 -68
@@ -1,26 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "assert/assertions"
|
3
5
|
|
4
6
|
require "assert/utils"
|
5
7
|
|
6
8
|
module Assert::Assertions
|
7
|
-
|
8
9
|
class AssertFileExistsTests < Assert::Context
|
9
10
|
include Assert::Test::TestHelpers
|
10
11
|
|
11
12
|
desc "`assert_file_exists`"
|
12
|
-
subject
|
13
|
-
|
14
|
-
let(:desc1) { "assert file exists fail desc" }
|
15
|
-
let(:args1) { ["/a/path/to/some/file/that/no/exists", desc1] }
|
16
|
-
let(:test1) {
|
13
|
+
subject do
|
17
14
|
args = args1
|
18
15
|
Factory.test do
|
19
16
|
assert_file_exists(__FILE__) # pass
|
20
17
|
assert_file_exists(*args) # fail
|
21
18
|
end
|
22
|
-
|
23
|
-
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:desc1){ "assert file exists fail desc" }
|
22
|
+
let(:args1){ ["/a/path/to/some/file/that/no/exists", desc1] }
|
23
|
+
let(:config1){ subject.config }
|
24
24
|
|
25
25
|
should "produce results as expected" do
|
26
26
|
subject.run(&test_run_callback)
|
@@ -29,7 +29,8 @@ module Assert::Assertions
|
|
29
29
|
assert_that(test_run_result_count(:pass)).equals(1)
|
30
30
|
assert_that(test_run_result_count(:fail)).equals(1)
|
31
31
|
|
32
|
-
exp =
|
32
|
+
exp =
|
33
|
+
"#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to exist."
|
33
34
|
assert_that(test_run_results(:fail).first.message).equals(exp)
|
34
35
|
end
|
35
36
|
end
|
@@ -38,18 +39,17 @@ module Assert::Assertions
|
|
38
39
|
include Assert::Test::TestHelpers
|
39
40
|
|
40
41
|
desc "`assert_not_file_exists`"
|
41
|
-
subject
|
42
|
-
|
43
|
-
let(:desc1) { "assert not file exists fail desc" }
|
44
|
-
let(:args1) { [__FILE__, desc1] }
|
45
|
-
let(:test1) {
|
42
|
+
subject do
|
46
43
|
args = args1
|
47
44
|
Factory.test do
|
48
45
|
assert_not_file_exists("/file/path") # pass
|
49
46
|
assert_not_file_exists(*args) # fail
|
50
47
|
end
|
51
|
-
|
52
|
-
|
48
|
+
end
|
49
|
+
|
50
|
+
let(:desc1){ "assert not file exists fail desc" }
|
51
|
+
let(:args1){ [__FILE__, desc1] }
|
52
|
+
let(:config1){ subject.config }
|
53
53
|
|
54
54
|
should "produce results as expected" do
|
55
55
|
subject.run(&test_run_callback)
|
@@ -58,7 +58,9 @@ module Assert::Assertions
|
|
58
58
|
assert_that(test_run_result_count(:pass)).equals(1)
|
59
59
|
assert_that(test_run_result_count(:fail)).equals(1)
|
60
60
|
|
61
|
-
exp =
|
61
|
+
exp =
|
62
|
+
"#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to "\
|
63
|
+
"not exist."
|
62
64
|
assert_that(test_run_results(:fail).first.message).equals(exp)
|
63
65
|
end
|
64
66
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "assert/assertions"
|
3
5
|
|
@@ -8,18 +10,17 @@ module Assert::Assertions
|
|
8
10
|
include Assert::Test::TestHelpers
|
9
11
|
|
10
12
|
desc "`assert_includes`"
|
11
|
-
subject
|
12
|
-
|
13
|
-
let(:desc1) { "assert includes fail desc" }
|
14
|
-
let(:args1) { [2, [1], desc1] }
|
15
|
-
let(:test1) {
|
13
|
+
subject do
|
16
14
|
args = args1
|
17
15
|
Factory.test do
|
18
16
|
assert_includes(1, [1]) # pass
|
19
17
|
assert_includes(*args) # fail
|
20
18
|
end
|
21
|
-
|
22
|
-
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:desc1){ "assert includes fail desc" }
|
22
|
+
let(:args1){ [2, [1], desc1] }
|
23
|
+
let(:config1){ subject.config }
|
23
24
|
|
24
25
|
should "produce results as expected" do
|
25
26
|
subject.run(&test_run_callback)
|
@@ -40,18 +41,17 @@ module Assert::Assertions
|
|
40
41
|
include Assert::Test::TestHelpers
|
41
42
|
|
42
43
|
desc "`assert_not_included`"
|
43
|
-
subject
|
44
|
-
|
45
|
-
let(:desc1) { "assert not included fail desc" }
|
46
|
-
let(:args1) { [1, [1], desc1] }
|
47
|
-
let(:test1) {
|
44
|
+
subject do
|
48
45
|
args = args1
|
49
46
|
Factory.test do
|
50
47
|
assert_not_included(2, [1]) # pass
|
51
48
|
assert_not_included(*args) # fail
|
52
49
|
end
|
53
|
-
|
54
|
-
|
50
|
+
end
|
51
|
+
|
52
|
+
let(:desc1){ "assert not included fail desc" }
|
53
|
+
let(:args1){ [1, [1], desc1] }
|
54
|
+
let(:config1){ subject.config }
|
55
55
|
|
56
56
|
should "produce results as expected" do
|
57
57
|
subject.run(&test_run_callback)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "assert/assertions"
|
3
5
|
|
@@ -8,18 +10,17 @@ module Assert::Assertions
|
|
8
10
|
include Assert::Test::TestHelpers
|
9
11
|
|
10
12
|
desc "`assert_instance_of`"
|
11
|
-
subject
|
12
|
-
|
13
|
-
let(:desc1) { "assert instance of fail desc" }
|
14
|
-
let(:args1) { [Array, "object", desc1] }
|
15
|
-
let(:test1) {
|
13
|
+
subject do
|
16
14
|
args = args1
|
17
15
|
Factory.test do
|
18
16
|
assert_instance_of(String, "object") # pass
|
19
17
|
assert_instance_of(*args) # fail
|
20
18
|
end
|
21
|
-
|
22
|
-
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:desc1){ "assert instance of fail desc" }
|
22
|
+
let(:args1){ [Array, "object", desc1] }
|
23
|
+
let(:config1){ subject.config }
|
23
24
|
|
24
25
|
should "produce results as expected" do
|
25
26
|
subject.run(&test_run_callback)
|
@@ -29,8 +30,8 @@ module Assert::Assertions
|
|
29
30
|
assert_that(test_run_result_count(:fail)).equals(1)
|
30
31
|
|
31
32
|
exp =
|
32
|
-
"#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)}
|
33
|
-
" to be an instance of #{args1[0]}."
|
33
|
+
"#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)} "\
|
34
|
+
"(#{args1[1].class}) to be an instance of #{args1[0]}."
|
34
35
|
assert_that(test_run_results(:fail).first.message).equals(exp)
|
35
36
|
end
|
36
37
|
end
|
@@ -39,18 +40,17 @@ module Assert::Assertions
|
|
39
40
|
include Assert::Test::TestHelpers
|
40
41
|
|
41
42
|
desc "`assert_not_instance_of`"
|
42
|
-
subject
|
43
|
-
|
44
|
-
let(:desc1) { "assert not instance of fail desc" }
|
45
|
-
let(:args1) { [String, "object", desc1] }
|
46
|
-
let(:test1) {
|
43
|
+
subject do
|
47
44
|
args = args1
|
48
45
|
Factory.test do
|
49
46
|
assert_not_instance_of(*args) # fail
|
50
47
|
assert_not_instance_of(Array, "object") # pass
|
51
48
|
end
|
52
|
-
|
53
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
let(:desc1){ "assert not instance of fail desc" }
|
52
|
+
let(:args1){ [String, "object", desc1] }
|
53
|
+
let(:config1){ subject.config }
|
54
54
|
|
55
55
|
should "produce results as expected" do
|
56
56
|
subject.run(&test_run_callback)
|
@@ -60,8 +60,8 @@ module Assert::Assertions
|
|
60
60
|
assert_that(test_run_result_count(:fail)).equals(1)
|
61
61
|
|
62
62
|
exp =
|
63
|
-
"#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)}
|
64
|
-
" to not be an instance of #{args1[0]}."
|
63
|
+
"#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)} "\
|
64
|
+
"(#{args1[1].class}) to not be an instance of #{args1[0]}."
|
65
65
|
assert_that(test_run_results(:fail).first.message).equals(exp)
|
66
66
|
end
|
67
67
|
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "assert"
|
4
|
+
require "assert/assertions"
|
5
|
+
|
6
|
+
require "assert/utils"
|
7
|
+
|
8
|
+
module Assert::Assertions
|
9
|
+
class AssertIsATests < Assert::Context
|
10
|
+
include Assert::Test::TestHelpers
|
11
|
+
|
12
|
+
desc "`assert_is_a`"
|
13
|
+
subject do
|
14
|
+
args = args1
|
15
|
+
Factory.test do
|
16
|
+
assert_is_a(String, "object") # pass
|
17
|
+
assert_is_a(*args) # fail
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:desc1){ "assert kind of fail desc" }
|
22
|
+
let(:args1){ [Array, "object", desc1] }
|
23
|
+
let(:config1){ subject.config }
|
24
|
+
|
25
|
+
should "produce results as expected" do
|
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)
|
31
|
+
|
32
|
+
exp =
|
33
|
+
"#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)} "\
|
34
|
+
"(#{args1[1].class}) to be a `#{args1[0]}`."
|
35
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class AssertIsNotATests < Assert::Context
|
40
|
+
include Assert::Test::TestHelpers
|
41
|
+
|
42
|
+
desc "`assert_not_kind_of`"
|
43
|
+
subject do
|
44
|
+
args = args1
|
45
|
+
Factory.test do
|
46
|
+
assert_is_not_a(*args) # fail
|
47
|
+
assert_is_not_a(Array, "object") # pass
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
let(:desc1){ "assert not kind of fail desc" }
|
52
|
+
let(:args1){ [String, "object", desc1] }
|
53
|
+
let(:config1){ subject.config }
|
54
|
+
|
55
|
+
should "produce results as expected" do
|
56
|
+
subject.run(&test_run_callback)
|
57
|
+
|
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
|
+
"(#{args1[1].class}) to not be a `#{args1[0]}`."
|
65
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
class AssertKindOfTests < Assert::Context
|
70
|
+
include Assert::Test::TestHelpers
|
71
|
+
|
72
|
+
desc "`assert_kind_of`"
|
73
|
+
subject do
|
74
|
+
args = args1
|
75
|
+
Factory.test do
|
76
|
+
assert_kind_of(String, "object") # pass
|
77
|
+
assert_kind_of(*args) # fail
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
let(:desc1){ "assert kind of fail desc" }
|
82
|
+
let(:args1){ [Array, "object", desc1] }
|
83
|
+
let(:config1){ subject.config }
|
84
|
+
|
85
|
+
should "produce results as expected" do
|
86
|
+
subject.run(&test_run_callback)
|
87
|
+
|
88
|
+
assert_that(test_run_result_count).equals(2)
|
89
|
+
assert_that(test_run_result_count(:pass)).equals(1)
|
90
|
+
assert_that(test_run_result_count(:fail)).equals(1)
|
91
|
+
|
92
|
+
exp =
|
93
|
+
"#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)} "\
|
94
|
+
"(#{args1[1].class}) to be a `#{args1[0]}`."
|
95
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
class AssertNotKindOfTests < Assert::Context
|
100
|
+
include Assert::Test::TestHelpers
|
101
|
+
|
102
|
+
desc "`assert_not_kind_of`"
|
103
|
+
subject do
|
104
|
+
args = args1
|
105
|
+
Factory.test do
|
106
|
+
assert_not_kind_of(*args) # fail
|
107
|
+
assert_not_kind_of(Array, "object") # pass
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
let(:desc1){ "assert not kind of fail desc" }
|
112
|
+
let(:args1){ [String, "object", desc1] }
|
113
|
+
let(:config1){ subject.config }
|
114
|
+
|
115
|
+
should "produce results as expected" do
|
116
|
+
subject.run(&test_run_callback)
|
117
|
+
|
118
|
+
assert_that(test_run_result_count).equals(2)
|
119
|
+
assert_that(test_run_result_count(:pass)).equals(1)
|
120
|
+
assert_that(test_run_result_count(:fail)).equals(1)
|
121
|
+
|
122
|
+
exp =
|
123
|
+
"#{args1[2]}\nExpected #{Assert::U.show(args1[1], config1)} "\
|
124
|
+
"(#{args1[1].class}) to not be a `#{args1[0]}`."
|
125
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "assert/assertions"
|
3
5
|
|
@@ -8,18 +10,17 @@ module Assert::Assertions
|
|
8
10
|
include Assert::Test::TestHelpers
|
9
11
|
|
10
12
|
desc "`assert_match`"
|
11
|
-
subject
|
12
|
-
|
13
|
-
let(:desc1) { "assert match fail desc" }
|
14
|
-
let(:args1) { ["not", "a string", desc1] }
|
15
|
-
let(:test1) {
|
13
|
+
subject do
|
16
14
|
args = args1
|
17
15
|
Factory.test do
|
18
16
|
assert_match(/a/, "a string") # pass
|
19
17
|
assert_match(*args) # fail
|
20
18
|
end
|
21
|
-
|
22
|
-
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:desc1){ "assert match fail desc" }
|
22
|
+
let(:args1){ ["not", "a string", desc1] }
|
23
|
+
let(:config1){ subject.config }
|
23
24
|
|
24
25
|
should "produce results as expected" do
|
25
26
|
subject.run(&test_run_callback)
|
@@ -39,18 +40,17 @@ module Assert::Assertions
|
|
39
40
|
include Assert::Test::TestHelpers
|
40
41
|
|
41
42
|
desc "`assert_not_match`"
|
42
|
-
subject
|
43
|
-
|
44
|
-
let(:desc1) { "assert not match fail desc" }
|
45
|
-
let(:args1) { [/a/, "a string", desc1] }
|
46
|
-
let(:test1) {
|
43
|
+
subject do
|
47
44
|
args = args1
|
48
45
|
Factory.test do
|
49
46
|
assert_not_match(*args) # fail
|
50
47
|
assert_not_match("not", "a string") # pass
|
51
48
|
end
|
52
|
-
|
53
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
let(:desc1){ "assert not match fail desc" }
|
52
|
+
let(:args1){ [/a/, "a string", desc1] }
|
53
|
+
let(:config1){ subject.config }
|
54
54
|
|
55
55
|
should "produce results as expected" do
|
56
56
|
subject.run(&test_run_callback)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "assert/assertions"
|
3
5
|
|
@@ -8,18 +10,17 @@ module Assert::Assertions
|
|
8
10
|
include Assert::Test::TestHelpers
|
9
11
|
|
10
12
|
desc "`assert_nil`"
|
11
|
-
subject
|
12
|
-
|
13
|
-
let(:desc1) { "assert nil empty fail desc" }
|
14
|
-
let(:args1) { [1, desc1] }
|
15
|
-
let(:test1) {
|
13
|
+
subject do
|
16
14
|
args = args1
|
17
15
|
Factory.test do
|
18
16
|
assert_nil(nil) # pass
|
19
17
|
assert_nil(*args) # fail
|
20
18
|
end
|
21
|
-
|
22
|
-
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:desc1){ "assert nil empty fail desc" }
|
22
|
+
let(:args1){ [1, desc1] }
|
23
|
+
let(:config1){ subject.config }
|
23
24
|
|
24
25
|
should "produce results as expected" do
|
25
26
|
subject.run(&test_run_callback)
|
@@ -28,7 +29,9 @@ module Assert::Assertions
|
|
28
29
|
assert_that(test_run_result_count(:pass)).equals(1)
|
29
30
|
assert_that(test_run_result_count(:fail)).equals(1)
|
30
31
|
|
31
|
-
exp =
|
32
|
+
exp =
|
33
|
+
"#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to "\
|
34
|
+
"be nil."
|
32
35
|
assert_that(test_run_results(:fail).first.message).equals(exp)
|
33
36
|
end
|
34
37
|
end
|
@@ -37,18 +40,17 @@ module Assert::Assertions
|
|
37
40
|
include Assert::Test::TestHelpers
|
38
41
|
|
39
42
|
desc "`assert_not_nil`"
|
40
|
-
subject
|
41
|
-
|
42
|
-
let(:desc1) { "assert not nil empty fail desc" }
|
43
|
-
let(:args1) { [nil, desc1] }
|
44
|
-
let(:test1) {
|
43
|
+
subject do
|
45
44
|
args = args1
|
46
45
|
Factory.test do
|
47
46
|
assert_not_nil(1) # pass
|
48
47
|
assert_not_nil(*args) # fail
|
49
48
|
end
|
50
|
-
|
51
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
let(:desc1){ "assert not nil empty fail desc" }
|
52
|
+
let(:args1){ [nil, desc1] }
|
53
|
+
let(:config1){ subject.config }
|
52
54
|
|
53
55
|
should "produce results as expected" do
|
54
56
|
subject.run(&test_run_callback)
|
@@ -57,7 +59,9 @@ module Assert::Assertions
|
|
57
59
|
assert_that(test_run_result_count(:pass)).equals(1)
|
58
60
|
assert_that(test_run_result_count(:fail)).equals(1)
|
59
61
|
|
60
|
-
exp =
|
62
|
+
exp =
|
63
|
+
"#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to "\
|
64
|
+
"not be nil."
|
61
65
|
assert_that(test_run_results(:fail).first.message).equals(exp)
|
62
66
|
end
|
63
67
|
end
|