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,71 +1,70 @@
|
|
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 AssertIncludesTests < Assert::Context
|
9
8
|
include Assert::Test::TestHelpers
|
10
9
|
|
11
10
|
desc "`assert_includes`"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
subject { test1 }
|
12
|
+
|
13
|
+
let(:desc1) { "assert includes fail desc" }
|
14
|
+
let(:args1) { [2, [1], desc1] }
|
15
|
+
let(:test1) {
|
16
|
+
args = args1
|
17
|
+
Factory.test do
|
18
|
+
assert_includes(1, [1]) # pass
|
19
|
+
assert_includes(*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
|
-
" to include #{Assert::U.show(@args[0], @c)}."
|
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)}"\
|
34
|
+
" to include #{Assert::U.show(args1[0], config1)}."
|
35
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
36
|
+
end
|
37
37
|
end
|
38
38
|
|
39
39
|
class AssertNotIncludedTests < Assert::Context
|
40
40
|
include Assert::Test::TestHelpers
|
41
41
|
|
42
42
|
desc "`assert_not_included`"
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
subject { test1 }
|
44
|
+
|
45
|
+
let(:desc1) { "assert not included fail desc" }
|
46
|
+
let(:args1) { [1, [1], desc1] }
|
47
|
+
let(:test1) {
|
48
|
+
args = args1
|
49
|
+
Factory.test do
|
50
|
+
assert_not_included(2, [1]) # pass
|
51
|
+
assert_not_included(*args) # fail
|
49
52
|
end
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
subject{ @test }
|
53
|
+
}
|
54
|
+
let(:config1) { test1.config }
|
54
55
|
|
55
56
|
should "produce results as expected" do
|
56
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
" to not include #{Assert::U.show(@args[0], @c)}."
|
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)}"\
|
66
|
+
" to not include #{Assert::U.show(args1[0], config1)}."
|
67
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
68
|
+
end
|
68
69
|
end
|
69
|
-
|
70
70
|
end
|
71
|
-
|
@@ -1,69 +1,68 @@
|
|
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 AssertInstanceOfTests < Assert::Context
|
9
8
|
include Assert::Test::TestHelpers
|
10
9
|
|
11
10
|
desc "`assert_instance_of`"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
subject { test1 }
|
12
|
+
|
13
|
+
let(:desc1) { "assert instance of fail desc" }
|
14
|
+
let(:args1) { [Array, "object", desc1] }
|
15
|
+
let(:test1) {
|
16
|
+
args = args1
|
17
|
+
Factory.test do
|
16
18
|
assert_instance_of(String, "object") # pass
|
17
19
|
assert_instance_of(*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)} (#{args1[1].class})"\
|
33
|
+
" to be an instance of #{args1[0]}."
|
34
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
35
|
+
end
|
36
36
|
end
|
37
37
|
|
38
38
|
class AssertNotInstanceOfTests < Assert::Context
|
39
39
|
include Assert::Test::TestHelpers
|
40
40
|
|
41
41
|
desc "`assert_not_instance_of`"
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
subject { test1 }
|
43
|
+
|
44
|
+
let(:desc1) { "assert not instance of fail desc" }
|
45
|
+
let(:args1) { [String, "object", desc1] }
|
46
|
+
let(:test1) {
|
47
|
+
args = args1
|
48
|
+
Factory.test do
|
46
49
|
assert_not_instance_of(*args) # fail
|
47
50
|
assert_not_instance_of(Array, "object") # 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)} (#{args1[1].class})"\
|
64
|
+
" to not be an instance of #{args1[0]}."
|
65
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
66
|
+
end
|
66
67
|
end
|
67
|
-
|
68
68
|
end
|
69
|
-
|
@@ -1,69 +1,68 @@
|
|
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 AssertKindOfTests < Assert::Context
|
9
8
|
include Assert::Test::TestHelpers
|
10
9
|
|
11
10
|
desc "`assert_kind_of`"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
subject { test1 }
|
12
|
+
|
13
|
+
let(:desc1) { "assert kind of fail desc" }
|
14
|
+
let(:args1) { [Array, "object", desc1] }
|
15
|
+
let(:test1) {
|
16
|
+
args = args1
|
17
|
+
Factory.test do
|
16
18
|
assert_kind_of(String, "object") # pass
|
17
19
|
assert_kind_of(*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)} (#{args1[1].class})"\
|
33
|
+
" to be a kind of #{args1[0]}."
|
34
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
35
|
+
end
|
36
36
|
end
|
37
37
|
|
38
38
|
class AssertNotKindOfTests < Assert::Context
|
39
39
|
include Assert::Test::TestHelpers
|
40
40
|
|
41
41
|
desc "`assert_not_kind_of`"
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
subject { test1 }
|
43
|
+
|
44
|
+
let(:desc1) { "assert not kind of fail desc" }
|
45
|
+
let(:args1) { [String, "object", desc1] }
|
46
|
+
let(:test1) {
|
47
|
+
args = args1
|
48
|
+
Factory.test do
|
46
49
|
assert_not_kind_of(*args) # fail
|
47
50
|
assert_not_kind_of(Array, "object") # 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)} (#{args1[1].class})"\
|
64
|
+
" to not be a kind of #{args1[0]}."
|
65
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
66
|
+
end
|
66
67
|
end
|
67
|
-
|
68
68
|
end
|
69
|
-
|
@@ -1,69 +1,68 @@
|
|
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 AssertMatchTests < Assert::Context
|
9
8
|
include Assert::Test::TestHelpers
|
10
9
|
|
11
10
|
desc "`assert_match`"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
subject { test1 }
|
12
|
+
|
13
|
+
let(:desc1) { "assert match fail desc" }
|
14
|
+
let(:args1) { ["not", "a string", desc1] }
|
15
|
+
let(:test1) {
|
16
|
+
args = args1
|
17
|
+
Factory.test do
|
16
18
|
assert_match(/a/, "a string") # pass
|
17
19
|
assert_match(*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 match #{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 AssertNotMatchTests < Assert::Context
|
39
39
|
include Assert::Test::TestHelpers
|
40
40
|
|
41
41
|
desc "`assert_not_match`"
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
subject { test1 }
|
43
|
+
|
44
|
+
let(:desc1) { "assert not match fail desc" }
|
45
|
+
let(:args1) { [/a/, "a string", desc1] }
|
46
|
+
let(:test1) {
|
47
|
+
args = args1
|
48
|
+
Factory.test do
|
46
49
|
assert_not_match(*args) # fail
|
47
50
|
assert_not_match("not", "a string") # 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 match #{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
|
end
|
69
|
-
|
@@ -1,67 +1,64 @@
|
|
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 AssertNilTests < Assert::Context
|
9
8
|
include Assert::Test::TestHelpers
|
10
9
|
|
11
10
|
desc "`assert_nil`"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
subject { test1 }
|
12
|
+
|
13
|
+
let(:desc1) { "assert nil empty fail desc" }
|
14
|
+
let(:args1) { [1, desc1] }
|
15
|
+
let(:test1) {
|
16
|
+
args = args1
|
17
|
+
Factory.test do
|
16
18
|
assert_nil(nil) # pass
|
17
19
|
assert_nil(*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 = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to be nil."
|
32
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
33
|
+
end
|
35
34
|
end
|
36
35
|
|
37
36
|
class AssertNotNilTests < Assert::Context
|
38
37
|
include Assert::Test::TestHelpers
|
39
38
|
|
40
39
|
desc "`assert_not_nil`"
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
subject { test1 }
|
41
|
+
|
42
|
+
let(:desc1) { "assert not nil empty fail desc" }
|
43
|
+
let(:args1) { [nil, desc1] }
|
44
|
+
let(:test1) {
|
45
|
+
args = args1
|
46
|
+
Factory.test do
|
45
47
|
assert_not_nil(1) # pass
|
46
48
|
assert_not_nil(*args) # fail
|
47
49
|
end
|
48
|
-
|
49
|
-
|
50
|
-
end
|
51
|
-
subject{ @test }
|
50
|
+
}
|
51
|
+
let(:config1) { test1.config }
|
52
52
|
|
53
53
|
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
|
54
|
+
subject.run(&test_run_callback)
|
58
55
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
56
|
+
assert_that(test_run_result_count).equals(2)
|
57
|
+
assert_that(test_run_result_count(:pass)).equals(1)
|
58
|
+
assert_that(test_run_result_count(:fail)).equals(1)
|
63
59
|
|
60
|
+
exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not be nil."
|
61
|
+
assert_that(test_run_results(:fail).first.message).equals(exp)
|
62
|
+
end
|
64
63
|
end
|
65
|
-
|
66
64
|
end
|
67
|
-
|