assert 2.16.5 → 2.18.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +7 -7
  2. data/Gemfile +3 -1
  3. data/README.md +79 -54
  4. data/assert.gemspec +6 -5
  5. data/bin/assert +4 -4
  6. data/lib/assert.rb +8 -18
  7. data/lib/assert/actual_value.rb +127 -0
  8. data/lib/assert/assert_runner.rb +7 -10
  9. data/lib/assert/assertions.rb +15 -28
  10. data/lib/assert/cli.rb +41 -57
  11. data/lib/assert/config.rb +8 -12
  12. data/lib/assert/config_helpers.rb +6 -10
  13. data/lib/assert/context.rb +30 -24
  14. data/lib/assert/context/let_dsl.rb +13 -0
  15. data/lib/assert/context/method_missing.rb +19 -0
  16. data/lib/assert/context/setup_dsl.rb +0 -4
  17. data/lib/assert/context/subject_dsl.rb +0 -4
  18. data/lib/assert/context/suite_dsl.rb +0 -4
  19. data/lib/assert/context/test_dsl.rb +5 -9
  20. data/lib/assert/context_info.rb +2 -6
  21. data/lib/assert/default_runner.rb +1 -5
  22. data/lib/assert/default_suite.rb +1 -6
  23. data/lib/assert/default_view.rb +8 -12
  24. data/lib/assert/factory.rb +1 -4
  25. data/lib/assert/file_line.rb +0 -4
  26. data/lib/assert/macro.rb +1 -4
  27. data/lib/assert/macros/methods.rb +5 -11
  28. data/lib/assert/result.rb +19 -34
  29. data/lib/assert/runner.rb +12 -11
  30. data/lib/assert/stub.rb +16 -2
  31. data/lib/assert/suite.rb +3 -7
  32. data/lib/assert/test.rb +13 -18
  33. data/lib/assert/utils.rb +8 -12
  34. data/lib/assert/version.rb +1 -1
  35. data/lib/assert/view.rb +18 -21
  36. data/lib/assert/view_helpers.rb +6 -17
  37. data/log/{.gitkeep → .keep} +0 -0
  38. data/test/helper.rb +26 -41
  39. data/test/support/factory.rb +20 -6
  40. data/test/support/inherited_stuff.rb +0 -2
  41. data/test/system/stub_tests.rb +350 -354
  42. data/test/system/test_tests.rb +119 -133
  43. data/test/unit/actual_value_tests.rb +335 -0
  44. data/test/unit/assert_tests.rb +125 -52
  45. data/test/unit/assertions/assert_block_tests.rb +34 -37
  46. data/test/unit/assertions/assert_empty_tests.rb +38 -38
  47. data/test/unit/assertions/assert_equal_tests.rb +84 -86
  48. data/test/unit/assertions/assert_file_exists_tests.rb +37 -39
  49. data/test/unit/assertions/assert_includes_tests.rb +45 -46
  50. data/test/unit/assertions/assert_instance_of_tests.rb +39 -40
  51. data/test/unit/assertions/assert_kind_of_tests.rb +39 -40
  52. data/test/unit/assertions/assert_match_tests.rb +39 -40
  53. data/test/unit/assertions/assert_nil_tests.rb +35 -38
  54. data/test/unit/assertions/assert_raises_tests.rb +58 -62
  55. data/test/unit/assertions/assert_respond_to_tests.rb +41 -42
  56. data/test/unit/assertions/assert_same_tests.rb +94 -90
  57. data/test/unit/assertions/assert_true_false_tests.rb +67 -69
  58. data/test/unit/assertions_tests.rb +17 -19
  59. data/test/unit/config_helpers_tests.rb +41 -43
  60. data/test/unit/config_tests.rb +42 -46
  61. data/test/unit/context/let_dsl_tests.rb +10 -0
  62. data/test/unit/context/setup_dsl_tests.rb +72 -91
  63. data/test/unit/context/subject_dsl_tests.rb +18 -51
  64. data/test/unit/context/suite_dsl_tests.rb +19 -23
  65. data/test/unit/context/test_dsl_tests.rb +52 -59
  66. data/test/unit/context_info_tests.rb +19 -21
  67. data/test/unit/context_tests.rb +175 -178
  68. data/test/unit/default_runner_tests.rb +4 -10
  69. data/test/unit/default_suite_tests.rb +54 -59
  70. data/test/unit/factory_tests.rb +6 -9
  71. data/test/unit/file_line_tests.rb +34 -40
  72. data/test/unit/macro_tests.rb +11 -20
  73. data/test/unit/result_tests.rb +156 -182
  74. data/test/unit/runner_tests.rb +72 -79
  75. data/test/unit/suite_tests.rb +62 -63
  76. data/test/unit/test_tests.rb +143 -147
  77. data/test/unit/utils_tests.rb +49 -62
  78. data/test/unit/view_helpers_tests.rb +67 -70
  79. data/test/unit/view_tests.rb +26 -32
  80. metadata +54 -47
  81. data/.assert.rb +0 -3
  82. data/.gitignore +0 -19
@@ -1,13 +1,12 @@
1
- require 'assert'
2
- require 'assert/view'
1
+ require "assert"
2
+ require "assert/view"
3
3
 
4
- require 'stringio'
5
- require 'assert/config_helpers'
6
- require 'assert/suite'
7
- require 'assert/view_helpers'
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
- assert_includes Assert::ConfigHelpers, subject
17
+ assert_that(subject).includes(Assert::ConfigHelpers)
19
18
  end
20
19
 
21
20
  should "include the view helpers" do
22
- assert_includes Assert::ViewHelpers, subject
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
- setup do
30
- @io = StringIO.new("", "w+")
31
- @config = Factory.modes_off_config
27
+ subject { view1 }
32
28
 
33
- @view = Assert::View.new(@config, @io)
34
- end
35
- subject{ @view }
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
- assert_false subject.styled
40
+ assert_that(subject.styled).is_false
45
41
 
46
- assert_nil subject.pass_styles
47
- assert_nil subject.fail_styles
48
- assert_nil subject.error_styles
49
- assert_nil subject.skip_styles
50
- assert_nil subject.ignore_styles
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
- assert_equal '.', subject.pass_abbrev
55
- assert_equal 'F', subject.fail_abbrev
56
- assert_equal 'I', subject.ignore_abbrev
57
- assert_equal 'S', subject.skip_abbrev
58
- assert_equal 'E', subject.error_abbrev
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
- assert_equal @config, subject.config
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
- assert_equal subject, subject.view
62
+ assert_that(subject.view).equals(subject)
67
63
  end
68
64
 
69
65
  should "know if it is a tty" do
70
- assert_equal !!@io.isatty, subject.is_tty?
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.16.5
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
- date: 2018-06-06 00:00:00 Z
14
- dependencies:
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
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- requirements:
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
- requirement: &id003 !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ~>
31
- - *id002
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
- version_requirements: *id003
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/.gitkeep
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
- - &id004
137
- - ">="
138
- - !ruby/object:Gem::Version
139
- version: "0"
140
- required_rubygems_version: !ruby/object:Gem::Requirement
141
- requirements:
142
- - *id004
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
@@ -1,3 +0,0 @@
1
- Assert.configure do |c|
2
- # puts "Applying local settings..."
3
- end
data/.gitignore DELETED
@@ -1,19 +0,0 @@
1
- *.gem
2
- *.log
3
- *.rbc
4
- .rbx/
5
- .bundle
6
- .config
7
- .yardoc
8
- Gemfile.lock
9
- InstalledFiles
10
- _yardoc
11
- coverage
12
- doc/
13
- lib/bundler/man
14
- pkg
15
- rdoc
16
- spec/reports
17
- test/tmp
18
- test/version_tmp
19
- tmp