assert 2.16.5 → 2.18.3
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/test/unit/view_tests.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "assert"
|
2
|
+
require "assert/view"
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
4
|
+
require "stringio"
|
5
|
+
require "assert/config_helpers"
|
6
|
+
require "assert/suite"
|
7
|
+
require "assert/view_helpers"
|
8
8
|
|
9
9
|
class Assert::View
|
10
|
-
|
11
10
|
class UnitTests < Assert::Context
|
12
11
|
desc "Assert::View"
|
13
12
|
subject { Assert::View }
|
@@ -15,24 +14,21 @@ class Assert::View
|
|
15
14
|
should have_instance_method :require_user_view
|
16
15
|
|
17
16
|
should "include the config helpers" do
|
18
|
-
|
17
|
+
assert_that(subject).includes(Assert::ConfigHelpers)
|
19
18
|
end
|
20
19
|
|
21
20
|
should "include the view helpers" do
|
22
|
-
|
21
|
+
assert_that(subject).includes(Assert::ViewHelpers)
|
23
22
|
end
|
24
|
-
|
25
23
|
end
|
26
24
|
|
27
25
|
class InitTests < UnitTests
|
28
26
|
desc "when init"
|
29
|
-
|
30
|
-
@io = StringIO.new("", "w+")
|
31
|
-
@config = Factory.modes_off_config
|
27
|
+
subject { view1 }
|
32
28
|
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
let(:io1) { StringIO.new("", "w+") }
|
30
|
+
let(:config1) { Factory.modes_off_config }
|
31
|
+
let(:view1) { Assert::View.new(config1, io1) }
|
36
32
|
|
37
33
|
should have_readers :config
|
38
34
|
should have_imeths :view, :is_tty?
|
@@ -41,35 +37,33 @@ class Assert::View
|
|
41
37
|
should have_imeths :before_test, :after_test, :on_result
|
42
38
|
|
43
39
|
should "default its style options" do
|
44
|
-
|
40
|
+
assert_that(subject.styled).is_false
|
45
41
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
42
|
+
assert_that(subject.pass_styles).is_nil
|
43
|
+
assert_that(subject.fail_styles).is_nil
|
44
|
+
assert_that(subject.error_styles).is_nil
|
45
|
+
assert_that(subject.skip_styles).is_nil
|
46
|
+
assert_that(subject.ignore_styles).is_nil
|
51
47
|
end
|
52
48
|
|
53
49
|
should "default its result abbreviations" do
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
assert_that(subject.pass_abbrev).equals(".")
|
51
|
+
assert_that(subject.fail_abbrev).equals("F")
|
52
|
+
assert_that(subject.ignore_abbrev).equals("I")
|
53
|
+
assert_that(subject.skip_abbrev).equals("S")
|
54
|
+
assert_that(subject.error_abbrev).equals("E")
|
59
55
|
end
|
60
56
|
|
61
57
|
should "know its config" do
|
62
|
-
|
58
|
+
assert_that(subject.config).equals(config1)
|
63
59
|
end
|
64
60
|
|
65
61
|
should "override the config helper's view value with itself" do
|
66
|
-
|
62
|
+
assert_that(subject.view).equals(subject)
|
67
63
|
end
|
68
64
|
|
69
65
|
should "know if it is a tty" do
|
70
|
-
|
66
|
+
assert_that(subject.is_tty?).equals(!!io1.isatty)
|
71
67
|
end
|
72
|
-
|
73
68
|
end
|
74
|
-
|
75
69
|
end
|
metadata
CHANGED
@@ -1,61 +1,68 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.18.3
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Kelly Redding
|
8
8
|
- Collin Redding
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: much-factory
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- &id002 !ruby/object:Gem::Version
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
22
20
|
version: 0.1.0
|
23
21
|
type: :runtime
|
24
|
-
version_requirements: *id001
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: much-stub
|
27
22
|
prerelease: false
|
28
|
-
|
29
|
-
requirements:
|
30
|
-
- - ~>
|
31
|
-
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.1.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: much-stub
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.1.4
|
32
35
|
type: :runtime
|
33
|
-
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.1.4
|
34
42
|
description: Assertion style testing framework.
|
35
|
-
email:
|
43
|
+
email:
|
36
44
|
- kelly@kellyredding.com
|
37
45
|
- collin.redding@me.com
|
38
|
-
executables:
|
46
|
+
executables:
|
39
47
|
- assert
|
40
48
|
extensions: []
|
41
|
-
|
42
49
|
extra_rdoc_files: []
|
43
|
-
|
44
|
-
files:
|
45
|
-
- .assert.rb
|
46
|
-
- .gitignore
|
50
|
+
files:
|
47
51
|
- Gemfile
|
48
52
|
- LICENSE
|
49
53
|
- README.md
|
50
54
|
- assert.gemspec
|
51
55
|
- bin/assert
|
52
56
|
- lib/assert.rb
|
57
|
+
- lib/assert/actual_value.rb
|
53
58
|
- lib/assert/assert_runner.rb
|
54
59
|
- lib/assert/assertions.rb
|
55
60
|
- lib/assert/cli.rb
|
56
61
|
- lib/assert/config.rb
|
57
62
|
- lib/assert/config_helpers.rb
|
58
63
|
- lib/assert/context.rb
|
64
|
+
- lib/assert/context/let_dsl.rb
|
65
|
+
- lib/assert/context/method_missing.rb
|
59
66
|
- lib/assert/context/setup_dsl.rb
|
60
67
|
- lib/assert/context/subject_dsl.rb
|
61
68
|
- lib/assert/context/suite_dsl.rb
|
@@ -77,7 +84,7 @@ files:
|
|
77
84
|
- lib/assert/version.rb
|
78
85
|
- lib/assert/view.rb
|
79
86
|
- lib/assert/view_helpers.rb
|
80
|
-
- log/.
|
87
|
+
- log/.keep
|
81
88
|
- test/helper.rb
|
82
89
|
- test/support/diff_a.txt
|
83
90
|
- test/support/diff_b.txt
|
@@ -85,6 +92,7 @@ files:
|
|
85
92
|
- test/support/inherited_stuff.rb
|
86
93
|
- test/system/stub_tests.rb
|
87
94
|
- test/system/test_tests.rb
|
95
|
+
- test/unit/actual_value_tests.rb
|
88
96
|
- test/unit/assert_tests.rb
|
89
97
|
- test/unit/assertions/assert_block_tests.rb
|
90
98
|
- test/unit/assertions/assert_empty_tests.rb
|
@@ -102,6 +110,7 @@ files:
|
|
102
110
|
- test/unit/assertions_tests.rb
|
103
111
|
- test/unit/config_helpers_tests.rb
|
104
112
|
- test/unit/config_tests.rb
|
113
|
+
- test/unit/context/let_dsl_tests.rb
|
105
114
|
- test/unit/context/setup_dsl_tests.rb
|
106
115
|
- test/unit/context/subject_dsl_tests.rb
|
107
116
|
- test/unit/context/suite_dsl_tests.rb
|
@@ -120,34 +129,30 @@ files:
|
|
120
129
|
- test/unit/utils_tests.rb
|
121
130
|
- test/unit/view_helpers_tests.rb
|
122
131
|
- test/unit/view_tests.rb
|
123
|
-
- tmp/.gitkeep
|
124
132
|
homepage: http://github.com/redding/assert
|
125
|
-
licenses:
|
133
|
+
licenses:
|
126
134
|
- MIT
|
127
135
|
metadata: {}
|
128
|
-
|
129
136
|
post_install_message:
|
130
137
|
rdoc_options: []
|
131
|
-
|
132
|
-
require_paths:
|
138
|
+
require_paths:
|
133
139
|
- lib
|
134
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
-
|
137
|
-
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '2.5'
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
143
150
|
requirements: []
|
144
|
-
|
145
|
-
rubyforge_project:
|
146
|
-
rubygems_version: 2.6.6
|
151
|
+
rubygems_version: 3.1.2
|
147
152
|
signing_key:
|
148
153
|
specification_version: 4
|
149
154
|
summary: Assertion style testing framework.
|
150
|
-
test_files:
|
155
|
+
test_files:
|
151
156
|
- test/helper.rb
|
152
157
|
- test/support/diff_a.txt
|
153
158
|
- test/support/diff_b.txt
|
@@ -155,6 +160,7 @@ test_files:
|
|
155
160
|
- test/support/inherited_stuff.rb
|
156
161
|
- test/system/stub_tests.rb
|
157
162
|
- test/system/test_tests.rb
|
163
|
+
- test/unit/actual_value_tests.rb
|
158
164
|
- test/unit/assert_tests.rb
|
159
165
|
- test/unit/assertions/assert_block_tests.rb
|
160
166
|
- test/unit/assertions/assert_empty_tests.rb
|
@@ -172,6 +178,7 @@ test_files:
|
|
172
178
|
- test/unit/assertions_tests.rb
|
173
179
|
- test/unit/config_helpers_tests.rb
|
174
180
|
- test/unit/config_tests.rb
|
181
|
+
- test/unit/context/let_dsl_tests.rb
|
175
182
|
- test/unit/context/setup_dsl_tests.rb
|
176
183
|
- test/unit/context/subject_dsl_tests.rb
|
177
184
|
- test/unit/context/suite_dsl_tests.rb
|
data/.assert.rb
DELETED