assert 2.17.0 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/README.md +0 -4
  4. data/assert.gemspec +2 -3
  5. data/lib/assert.rb +0 -10
  6. data/lib/assert/assert_runner.rb +0 -3
  7. data/lib/assert/assertions.rb +0 -4
  8. data/lib/assert/cli.rb +30 -46
  9. data/lib/assert/config.rb +0 -4
  10. data/lib/assert/config_helpers.rb +0 -4
  11. data/lib/assert/context.rb +0 -2
  12. data/lib/assert/context/setup_dsl.rb +0 -4
  13. data/lib/assert/context/subject_dsl.rb +0 -4
  14. data/lib/assert/context/suite_dsl.rb +0 -4
  15. data/lib/assert/context/test_dsl.rb +0 -4
  16. data/lib/assert/context_info.rb +0 -4
  17. data/lib/assert/default_runner.rb +0 -4
  18. data/lib/assert/default_suite.rb +0 -5
  19. data/lib/assert/default_view.rb +0 -4
  20. data/lib/assert/factory.rb +0 -3
  21. data/lib/assert/file_line.rb +0 -4
  22. data/lib/assert/macro.rb +0 -3
  23. data/lib/assert/macros/methods.rb +0 -6
  24. data/lib/assert/result.rb +2 -17
  25. data/lib/assert/runner.rb +0 -3
  26. data/lib/assert/stub.rb +0 -2
  27. data/lib/assert/suite.rb +0 -4
  28. data/lib/assert/test.rb +2 -7
  29. data/lib/assert/utils.rb +0 -4
  30. data/lib/assert/version.rb +1 -1
  31. data/lib/assert/view.rb +0 -3
  32. data/lib/assert/view_helpers.rb +0 -11
  33. data/log/{.gitkeep → .keep} +0 -0
  34. data/test/helper.rb +0 -4
  35. data/test/support/factory.rb +0 -1
  36. data/test/support/inherited_stuff.rb +0 -2
  37. data/test/system/stub_tests.rb +0 -19
  38. data/test/system/test_tests.rb +0 -16
  39. data/test/unit/assert_tests.rb +0 -4
  40. data/test/unit/assertions/assert_block_tests.rb +0 -4
  41. data/test/unit/assertions/assert_empty_tests.rb +0 -3
  42. data/test/unit/assertions/assert_equal_tests.rb +0 -8
  43. data/test/unit/assertions/assert_file_exists_tests.rb +0 -3
  44. data/test/unit/assertions/assert_includes_tests.rb +0 -4
  45. data/test/unit/assertions/assert_instance_of_tests.rb +0 -4
  46. data/test/unit/assertions/assert_kind_of_tests.rb +0 -4
  47. data/test/unit/assertions/assert_match_tests.rb +0 -4
  48. data/test/unit/assertions/assert_nil_tests.rb +0 -4
  49. data/test/unit/assertions/assert_raises_tests.rb +2 -6
  50. data/test/unit/assertions/assert_respond_to_tests.rb +0 -4
  51. data/test/unit/assertions/assert_same_tests.rb +0 -7
  52. data/test/unit/assertions/assert_true_false_tests.rb +0 -6
  53. data/test/unit/assertions_tests.rb +0 -4
  54. data/test/unit/config_helpers_tests.rb +0 -3
  55. data/test/unit/config_tests.rb +0 -3
  56. data/test/unit/context/setup_dsl_tests.rb +0 -8
  57. data/test/unit/context/subject_dsl_tests.rb +0 -6
  58. data/test/unit/context/suite_dsl_tests.rb +0 -4
  59. data/test/unit/context/test_dsl_tests.rb +0 -3
  60. data/test/unit/context_info_tests.rb +0 -3
  61. data/test/unit/context_tests.rb +2 -18
  62. data/test/unit/default_runner_tests.rb +0 -3
  63. data/test/unit/default_suite_tests.rb +0 -3
  64. data/test/unit/factory_tests.rb +0 -3
  65. data/test/unit/file_line_tests.rb +0 -4
  66. data/test/unit/macro_tests.rb +0 -8
  67. data/test/unit/result_tests.rb +0 -13
  68. data/test/unit/runner_tests.rb +0 -7
  69. data/test/unit/suite_tests.rb +0 -4
  70. data/test/unit/test_tests.rb +0 -12
  71. data/test/unit/utils_tests.rb +0 -9
  72. data/test/unit/view_helpers_tests.rb +0 -6
  73. data/test/unit/view_tests.rb +0 -4
  74. metadata +8 -9
  75. data/tmp/.gitkeep +0 -0
@@ -4,7 +4,6 @@ require "assert/assertions"
4
4
  require "assert/utils"
5
5
 
6
6
  module Assert::Assertions
7
-
8
7
  class AssertTrueTests < Assert::Context
9
8
  include Assert::Test::TestHelpers
10
9
 
@@ -31,7 +30,6 @@ module Assert::Assertions
31
30
  exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to be true."
32
31
  assert_equal exp, test_run_results(:fail).first.message
33
32
  end
34
-
35
33
  end
36
34
 
37
35
  class AssertNotTrueTests < Assert::Context
@@ -60,7 +58,6 @@ module Assert::Assertions
60
58
  exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to not be true."
61
59
  assert_equal exp, test_run_results(:fail).first.message
62
60
  end
63
-
64
61
  end
65
62
 
66
63
  class AssertFalseTests < Assert::Context
@@ -89,7 +86,6 @@ module Assert::Assertions
89
86
  exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to be false."
90
87
  assert_equal exp, test_run_results(:fail).first.message
91
88
  end
92
-
93
89
  end
94
90
 
95
91
  class AssertNotFalseTests < Assert::Context
@@ -118,7 +114,5 @@ module Assert::Assertions
118
114
  exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to not be false."
119
115
  assert_equal exp, test_run_results(:fail).first.message
120
116
  end
121
-
122
117
  end
123
-
124
118
  end
@@ -2,7 +2,6 @@ require "assert"
2
2
  require "assert/assertions"
3
3
 
4
4
  module Assert::Assertions
5
-
6
5
  class UnitTests < Assert::Context
7
6
  include Assert::Test::TestHelpers
8
7
 
@@ -33,7 +32,6 @@ module Assert::Assertions
33
32
  should have_imeths :assert_true, :assert_not_true, :refute_true
34
33
  should have_imeths :assert_false, :assert_not_false, :refute_false
35
34
  should have_imeths :assert_file_exists, :assert_not_file_exists, :refute_file_exists
36
-
37
35
  end
38
36
 
39
37
  class IgnoredTests < UnitTests
@@ -64,7 +62,5 @@ module Assert::Assertions
64
62
  end
65
63
  assert_equal exp, test_run_results.collect(&:message)
66
64
  end
67
-
68
65
  end
69
-
70
66
  end
@@ -4,7 +4,6 @@ require "assert/config_helpers"
4
4
  require "assert/config"
5
5
 
6
6
  module Assert::ConfigHelpers
7
-
8
7
  class UnitTests < Assert::Context
9
8
  desc "Assert::ConfigHelpers"
10
9
  setup do
@@ -148,7 +147,5 @@ module Assert::ConfigHelpers
148
147
  end
149
148
  assert_equal exp, subject.ocurring_result_types
150
149
  end
151
-
152
150
  end
153
-
154
151
  end
@@ -8,7 +8,6 @@ require "assert/file_line"
8
8
  require "assert/runner"
9
9
 
10
10
  class Assert::Config
11
-
12
11
  class UnitTests < Assert::Context
13
12
  desc "Assert::Config"
14
13
  setup do
@@ -94,7 +93,5 @@ class Assert::Config
94
93
  subject.apply(:single_test => file_line_path)
95
94
  assert_equal File.expand_path(path, Dir.pwd), subject.single_test_file_path
96
95
  end
97
-
98
96
  end
99
-
100
97
  end
@@ -2,11 +2,9 @@ require "assert"
2
2
  require "assert/context/setup_dsl"
3
3
 
4
4
  module Assert::Context::SetupDSL
5
-
6
5
  class UnitTests < Assert::Context
7
6
  desc "Assert::Context::SetupDSL"
8
7
  subject{ @context_class }
9
-
10
8
  end
11
9
 
12
10
  class SetupTeardownOnceMethodsTests < UnitTests
@@ -23,7 +21,6 @@ module Assert::Context::SetupDSL
23
21
  assert_includes @block, subject.suite.send(:setups)
24
22
  assert_includes @block, subject.suite.send(:teardowns)
25
23
  end
26
-
27
24
  end
28
25
 
29
26
  class SetupTeardownMethodsTests < UnitTests
@@ -40,7 +37,6 @@ module Assert::Context::SetupDSL
40
37
  assert_includes @block, subject.send(:setups)
41
38
  assert_includes @block, subject.send(:teardowns)
42
39
  end
43
-
44
40
  end
45
41
 
46
42
  class SetupTeardownWithMethodNameTests < UnitTests
@@ -57,7 +53,6 @@ module Assert::Context::SetupDSL
57
53
  assert_includes @method_name, subject.send(:setups)
58
54
  assert_includes @method_name, subject.send(:teardowns)
59
55
  end
60
-
61
56
  end
62
57
 
63
58
  class SetupTeardownMultipleTests < UnitTests
@@ -97,7 +92,6 @@ module Assert::Context::SetupDSL
97
92
  subject.send("run_teardowns", obj = @test_status_class.new)
98
93
  assert_equal "with something has been run the teardown", obj.teardown_status
99
94
  end
100
-
101
95
  end
102
96
 
103
97
  class AroundMethodTests < UnitTests
@@ -141,7 +135,5 @@ module Assert::Context::SetupDSL
141
135
  "c-around2 end, c-around1 end, p-around end."
142
136
  assert_equal exp, obj.out_status
143
137
  end
144
-
145
138
  end
146
-
147
139
  end
@@ -6,7 +6,6 @@ module Assert::Context::SubjectDSL
6
6
  class UnitTests < Assert::Context
7
7
  desc "Assert::Context::SubjectDSL"
8
8
  subject{ @context_class }
9
-
10
9
  end
11
10
 
12
11
  class DescriptionsTests < UnitTests
@@ -21,7 +20,6 @@ module Assert::Context::SubjectDSL
21
20
  should "return a collection containing any descriptions defined on the class" do
22
21
  assert_equal @descs, subject.send(:descriptions)
23
22
  end
24
-
25
23
  end
26
24
 
27
25
  class DescriptionTests < UnitTests
@@ -41,7 +39,6 @@ module Assert::Context::SubjectDSL
41
39
  exp_desc = "parent description and the description for this context"
42
40
  assert_equal exp_desc, @context_class.description
43
41
  end
44
-
45
42
  end
46
43
 
47
44
  class SubjectFromLocalTests < UnitTests
@@ -56,7 +53,6 @@ module Assert::Context::SubjectDSL
56
53
  should "set the subject block on the context class" do
57
54
  assert_equal @subject_block, @context_class.subject
58
55
  end
59
-
60
56
  end
61
57
 
62
58
  class SubjectFromParentTests < UnitTests
@@ -72,7 +68,5 @@ module Assert::Context::SubjectDSL
72
68
  should "default to it's parents subject block" do
73
69
  assert_equal @parent_block, @context_class.subject
74
70
  end
75
-
76
71
  end
77
-
78
72
  end
@@ -4,7 +4,6 @@ require "assert/context/suite_dsl"
4
4
  require "assert/suite"
5
5
 
6
6
  module Assert::Context::SuiteDSL
7
-
8
7
  class UnitTests < Assert::Context
9
8
  desc "Assert::Context::SuiteDSL"
10
9
  setup do
@@ -21,7 +20,6 @@ module Assert::Context::SuiteDSL
21
20
  subject.suite(@custom_suite)
22
21
  assert_equal @custom_suite, subject.suite
23
22
  end
24
-
25
23
  end
26
24
 
27
25
  class SuiteFromParentTests < UnitTests
@@ -41,7 +39,5 @@ module Assert::Context::SuiteDSL
41
39
  subject.suite(another_suite)
42
40
  assert_equal another_suite, subject.suite
43
41
  end
44
-
45
42
  end
46
-
47
43
  end
@@ -2,7 +2,6 @@ require "assert"
2
2
  require "assert/context/test_dsl"
3
3
 
4
4
  module Assert::Context::TestDSL
5
-
6
5
  class UnitTests < Assert::Context
7
6
  desc "Assert::Context::TestDSL"
8
7
  setup do
@@ -158,7 +157,5 @@ module Assert::Context::TestDSL
158
157
  e
159
158
  end
160
159
  end
161
-
162
160
  end
163
-
164
161
  end
@@ -4,7 +4,6 @@ require "assert/context_info"
4
4
  require "assert/context"
5
5
 
6
6
  class Assert::ContextInfo
7
-
8
7
  class UnitTests < Assert::Context
9
8
  desc "Assert::ContextInfo"
10
9
  setup do
@@ -49,7 +48,5 @@ class Assert::ContextInfo
49
48
  Assert.stub(subject.klass, :description){ desc }
50
49
  assert_equal "#{desc} #{name}", subject.test_name(name)
51
50
  end
52
-
53
51
  end
54
-
55
52
  end
@@ -6,7 +6,6 @@ require "assert/result"
6
6
  require "assert/utils"
7
7
 
8
8
  class Assert::Context
9
-
10
9
  class UnitTests < Assert::Context
11
10
  desc "Assert::Context"
12
11
  setup do
@@ -38,7 +37,7 @@ class Assert::Context
38
37
 
39
38
  should "collect context info" do
40
39
  test = @__assert_running_test__
41
- assert_match /test\/unit\/context_tests.rb$/, test.context_info.file
40
+ assert_match(/test\/unit\/context_tests.rb$/, test.context_info.file)
42
41
  assert_equal self.class, test.context_info.klass
43
42
  end
44
43
  private
@@ -63,7 +62,6 @@ class Assert::Context
63
62
  assert_equal result.backtrace.filtered.first.to_s, result.src_line
64
63
  end
65
64
  end
66
-
67
65
  end
68
66
 
69
67
  class SkipTests < UnitTests
@@ -93,7 +91,6 @@ class Assert::Context
93
91
  assert_equal 1, exception.backtrace.size
94
92
  assert_equal called_from, exception.backtrace.first
95
93
  end
96
-
97
94
  end
98
95
 
99
96
  class IgnoreTests < UnitTests
@@ -112,7 +109,6 @@ class Assert::Context
112
109
  should "call the result callback" do
113
110
  assert_equal @result, @callback_result
114
111
  end
115
-
116
112
  end
117
113
 
118
114
  class PassTests < UnitTests
@@ -131,7 +127,6 @@ class Assert::Context
131
127
  should "call the result callback" do
132
128
  assert_equal @result, @callback_result
133
129
  end
134
-
135
130
  end
136
131
 
137
132
  class FlunkTests < UnitTests
@@ -150,7 +145,6 @@ class Assert::Context
150
145
  should "call the result callback" do
151
146
  assert_equal @result, @callback_result
152
147
  end
153
-
154
148
  end
155
149
 
156
150
  class FailTests < UnitTests
@@ -175,7 +169,6 @@ class Assert::Context
175
169
  should "call the result callback" do
176
170
  assert_equal @result, @callback_result
177
171
  end
178
-
179
172
  end
180
173
 
181
174
  class HaltOnFailTests < UnitTests
@@ -199,7 +192,6 @@ class Assert::Context
199
192
  should "not call the result callback" do
200
193
  assert_nil @callback_result
201
194
  end
202
-
203
195
  end
204
196
 
205
197
  class AssertTests < UnitTests
@@ -239,7 +231,6 @@ class Assert::Context
239
231
  should "return a fail result gievn a `nil` assertion" do
240
232
  assert_kind_of Assert::Result::Fail, subject.assert(nil)
241
233
  end
242
-
243
234
  end
244
235
 
245
236
  class AssertNotTests < UnitTests
@@ -273,7 +264,6 @@ class Assert::Context
273
264
  should "return a pass result given a `nil` assertion" do
274
265
  assert_kind_of Assert::Result::Pass, subject.assert_not(nil)
275
266
  end
276
-
277
267
  end
278
268
 
279
269
  class SubjectTests < UnitTests
@@ -291,7 +281,6 @@ class Assert::Context
291
281
  should "instance evaluate the block set with the class setup method" do
292
282
  assert_equal @expected, subject
293
283
  end
294
-
295
284
  end
296
285
 
297
286
  class PendingTests < UnitTests
@@ -318,7 +307,6 @@ class Assert::Context
318
307
  assert_kind_of Assert::Result::Fail, pending_pass
319
308
  assert_includes "Pending pass", pending_pass.message
320
309
  end
321
-
322
310
  end
323
311
 
324
312
  class PendingWithHaltOnFailTests < PendingTests
@@ -336,7 +324,6 @@ class Assert::Context
336
324
 
337
325
  assert_equal 0, @test_results.size # it halted before the pending pass
338
326
  end
339
-
340
327
  end
341
328
 
342
329
  class WithBacktraceTests < UnitTests
@@ -355,7 +342,7 @@ class Assert::Context
355
342
  end
356
343
 
357
344
  assert_equal 5, @test_results.size
358
- norm_fail, with_ignore, with_fail, with_pass, with_skip = @test_results
345
+ norm_fail, with_ignore, with_fail, with_pass, _with_skip = @test_results
359
346
 
360
347
  assert_not_with_bt_set norm_fail
361
348
 
@@ -365,7 +352,6 @@ class Assert::Context
365
352
  assert_with_bt_set exp, with_pass
366
353
  assert_with_bt_set exp, with_ignore
367
354
  end
368
-
369
355
  end
370
356
 
371
357
  class WithNestedBacktraceTests < UnitTests
@@ -397,7 +383,6 @@ class Assert::Context
397
383
  assert_with_bt_set exp, with_pass
398
384
  assert_with_bt_set exp, with_ignore
399
385
  end
400
-
401
386
  end
402
387
 
403
388
  class InspectTests < UnitTests
@@ -412,5 +397,4 @@ class Assert::Context
412
397
  assert_equal @expected, subject
413
398
  end
414
399
  end
415
-
416
400
  end
@@ -4,7 +4,6 @@ require "assert/default_runner"
4
4
  require "assert/runner"
5
5
 
6
6
  class Assert::DefaultRunner
7
-
8
7
  class UnitTests < Assert::Context
9
8
  desc "Assert::DefaultRunner"
10
9
  setup do
@@ -12,7 +11,5 @@ class Assert::DefaultRunner
12
11
  @runner = Assert::DefaultRunner.new(@config)
13
12
  end
14
13
  subject{ @runner }
15
-
16
14
  end
17
-
18
15
  end
@@ -4,7 +4,6 @@ require "assert/default_suite"
4
4
  require "assert/suite"
5
5
 
6
6
  class Assert::DefaultSuite
7
-
8
7
  class UnitTests < Assert::Context
9
8
  desc "Assert::DefaultSuite"
10
9
  setup do
@@ -91,7 +90,5 @@ class Assert::DefaultSuite
91
90
  assert_equal 0, subject.result_count
92
91
  assert_equal 0, subject.pass_result_count
93
92
  end
94
-
95
93
  end
96
-
97
94
  end
@@ -4,7 +4,6 @@ require "assert/factory"
4
4
  require "much-factory"
5
5
 
6
6
  module Assert::Factory
7
-
8
7
  class UnitTests < Assert::Context
9
8
  desc "Assert::Factory"
10
9
  subject{ Assert::Factory }
@@ -23,7 +22,5 @@ module Assert::Factory
23
22
  self
24
23
  end
25
24
  end
26
-
27
25
  end
28
-
29
26
  end
@@ -2,7 +2,6 @@ require "assert"
2
2
  require "assert/file_line"
3
3
 
4
4
  class Assert::FileLine
5
-
6
5
  class UnitTests < Assert::Context
7
6
  desc "Assert::FileLine"
8
7
  setup do
@@ -41,7 +40,6 @@ class Assert::FileLine
41
40
  assert_equal "", file_line.file
42
41
  assert_equal "", file_line.line
43
42
  end
44
-
45
43
  end
46
44
 
47
45
  class InitTests < UnitTests
@@ -77,7 +75,5 @@ class Assert::FileLine
77
75
  assert_equal yes, subject
78
76
  assert_not_equal no, subject
79
77
  end
80
-
81
78
  end
82
-
83
79
  end