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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -2
  3. data/assert.gemspec +11 -5
  4. data/bin/assert +1 -0
  5. data/lib/assert.rb +20 -6
  6. data/lib/assert/actual_value.rb +26 -8
  7. data/lib/assert/assert_runner.rb +38 -17
  8. data/lib/assert/assertions.rb +145 -41
  9. data/lib/assert/cli.rb +19 -66
  10. data/lib/assert/clirb.rb +55 -0
  11. data/lib/assert/config.rb +9 -7
  12. data/lib/assert/config_helpers.rb +57 -22
  13. data/lib/assert/context.rb +33 -49
  14. data/lib/assert/context/let_dsl.rb +10 -4
  15. data/lib/assert/context/method_missing.rb +3 -0
  16. data/lib/assert/context/setup_dsl.rb +24 -16
  17. data/lib/assert/context/subject_dsl.rb +26 -25
  18. data/lib/assert/context/suite_dsl.rb +5 -1
  19. data/lib/assert/context/test_dsl.rb +58 -19
  20. data/lib/assert/context_info.rb +2 -0
  21. data/lib/assert/default_runner.rb +2 -0
  22. data/lib/assert/default_suite.rb +27 -15
  23. data/lib/assert/default_view.rb +49 -30
  24. data/lib/assert/factory.rb +2 -0
  25. data/lib/assert/file_line.rb +8 -6
  26. data/lib/assert/macro.rb +3 -1
  27. data/lib/assert/macros/methods.rb +73 -45
  28. data/lib/assert/result.rb +117 -61
  29. data/lib/assert/runner.rb +70 -51
  30. data/lib/assert/stub.rb +44 -3
  31. data/lib/assert/suite.rb +76 -38
  32. data/lib/assert/test.rb +43 -44
  33. data/lib/assert/utils.rb +22 -11
  34. data/lib/assert/version.rb +3 -1
  35. data/lib/assert/view.rb +46 -18
  36. data/lib/assert/view_helpers.rb +102 -92
  37. data/test/helper.rb +8 -4
  38. data/test/support/factory.rb +40 -21
  39. data/test/support/inherited_stuff.rb +2 -0
  40. data/test/system/stub_tests.rb +272 -250
  41. data/test/system/test_tests.rb +89 -73
  42. data/test/unit/actual_value_tests.rb +103 -46
  43. data/test/unit/assert_tests.rb +49 -39
  44. data/test/unit/assertions/assert_block_tests.rb +14 -14
  45. data/test/unit/assertions/assert_changes_tests.rb +103 -0
  46. data/test/unit/assertions/assert_empty_tests.rb +18 -16
  47. data/test/unit/assertions/assert_equal_tests.rb +48 -32
  48. data/test/unit/assertions/assert_file_exists_tests.rb +19 -17
  49. data/test/unit/assertions/assert_includes_tests.rb +14 -14
  50. data/test/unit/assertions/assert_instance_of_tests.rb +18 -18
  51. data/test/unit/assertions/assert_is_a_tests.rb +128 -0
  52. data/test/unit/assertions/assert_match_tests.rb +14 -14
  53. data/test/unit/assertions/assert_nil_tests.rb +20 -16
  54. data/test/unit/assertions/assert_raises_tests.rb +36 -27
  55. data/test/unit/assertions/assert_respond_to_tests.rb +14 -14
  56. data/test/unit/assertions/assert_same_tests.rb +28 -32
  57. data/test/unit/assertions/assert_true_false_tests.rb +38 -32
  58. data/test/unit/assertions_tests.rb +25 -18
  59. data/test/unit/config_helpers_tests.rb +20 -9
  60. data/test/unit/config_tests.rb +16 -8
  61. data/test/unit/context/let_dsl_tests.rb +2 -0
  62. data/test/unit/context/setup_dsl_tests.rb +27 -15
  63. data/test/unit/context/subject_dsl_tests.rb +5 -4
  64. data/test/unit/context/suite_dsl_tests.rb +6 -5
  65. data/test/unit/context/test_dsl_tests.rb +43 -19
  66. data/test/unit/context_info_tests.rb +12 -3
  67. data/test/unit/context_tests.rb +166 -116
  68. data/test/unit/default_runner_tests.rb +2 -0
  69. data/test/unit/default_suite_tests.rb +17 -5
  70. data/test/unit/factory_tests.rb +5 -1
  71. data/test/unit/file_line_tests.rb +14 -12
  72. data/test/unit/macro_tests.rb +17 -10
  73. data/test/unit/result_tests.rb +72 -75
  74. data/test/unit/runner_tests.rb +38 -23
  75. data/test/unit/suite_tests.rb +48 -30
  76. data/test/unit/test_tests.rb +88 -102
  77. data/test/unit/utils_tests.rb +53 -36
  78. data/test/unit/view_helpers_tests.rb +25 -17
  79. data/test/unit/view_tests.rb +8 -5
  80. metadata +40 -9
  81. data/test/unit/assertions/assert_kind_of_tests.rb +0 -68
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert/config"
2
4
  require "assert/default_suite"
3
5
  require "assert/factory"
@@ -8,11 +10,17 @@ module Factory
8
10
  extend Assert::Factory
9
11
 
10
12
  def self.context_info_called_from
11
- File.expand_path("#{Factory.path}_tests.rb:#{Factory.integer}", Dir.pwd)
13
+ File.expand_path(
14
+ "#{Factory.path}_tests.rb:#{Factory.integer}",
15
+ Dir.pwd,
16
+ )
12
17
  end
13
18
 
14
19
  def self.context_info(context_klass = nil)
15
- Assert::ContextInfo.new(context_klass || self.context_class, context_info_called_from)
20
+ Assert::ContextInfo.new(
21
+ context_klass || context_class,
22
+ context_info_called_from,
23
+ )
16
24
  end
17
25
 
18
26
  # Generate an anonymous `Context` inherited from `Assert::Context` by default.
@@ -22,9 +30,8 @@ module Factory
22
30
  klass = Class.new(inherit_from || Assert::Context, &block)
23
31
  default = const_name = "FactoryAssertContext"
24
32
 
25
- while(Object.const_defined?(const_name)) do
26
- const_name = "#{default}#{rand(Time.now.to_i)}"
27
- end
33
+ const_name =
34
+ "#{default}#{rand(Time.now.to_i)}" while Object.const_defined?(const_name)
28
35
  Object.const_set(const_name, klass)
29
36
  klass
30
37
  end
@@ -33,9 +40,9 @@ module Factory
33
40
 
34
41
  def self.test(*args, &block)
35
42
  config, context_info, name = [
36
- args.last.kind_of?(Assert::Config) ? args.pop : self.modes_off_config,
37
- args.last.kind_of?(Assert::ContextInfo) ? args.pop : self.context_info,
38
- args.last.kind_of?(::String) ? args.pop : "a test"
43
+ args.last.is_a?(Assert::Config) ? args.pop : modes_off_config,
44
+ args.last.is_a?(Assert::ContextInfo) ? args.pop : self.context_info,
45
+ args.last.is_a?(::String) ? args.pop : "a test",
39
46
  ]
40
47
  Assert::Test.for_block(name, context_info, config, &block)
41
48
  end
@@ -43,15 +50,27 @@ module Factory
43
50
  # Generate results for use in testing.
44
51
 
45
52
  def self.pass_result(msg = nil)
46
- Assert::Result::Pass.for_test(Factory.test(Factory.string), msg || Factory.string, [])
53
+ Assert::Result::Pass.for_test(
54
+ Factory.test(Factory.string),
55
+ msg || Factory.string,
56
+ [],
57
+ )
47
58
  end
48
59
 
49
60
  def self.ignore_result(msg = nil)
50
- Assert::Result::Ignore.for_test(Factory.test(Factory.string), msg || Factory.string, [])
61
+ Assert::Result::Ignore.for_test(
62
+ Factory.test(Factory.string),
63
+ msg || Factory.string,
64
+ [],
65
+ )
51
66
  end
52
67
 
53
68
  def self.fail_result(msg = nil)
54
- Assert::Result::Fail.for_test(Factory.test(Factory.string), msg || Factory.string, [])
69
+ Assert::Result::Fail.for_test(
70
+ Factory.test(Factory.string),
71
+ msg || Factory.string,
72
+ [],
73
+ )
55
74
  end
56
75
 
57
76
  def self.skip_result(exception = nil)
@@ -66,23 +85,23 @@ module Factory
66
85
 
67
86
  def self.modes_off_config
68
87
  Assert::Config.new({
69
- :capture_output => false,
70
- :halt_on_fail => false,
71
- :changed_only => false,
72
- :pp_objects => false,
73
- :debug => false
88
+ capture_output: false,
89
+ halt_on_fail: false,
90
+ changed_only: false,
91
+ pp_objects: false,
92
+ debug: false,
74
93
  })
75
94
  end
76
95
 
77
96
  def self.modes_off_suite
78
- Assert::DefaultSuite.new(self.modes_off_config)
97
+ Assert::DefaultSuite.new(modes_off_config)
79
98
  end
80
99
 
81
100
  def self.modes_off_context_class(*args, &block)
82
- suite_obj = self.modes_off_suite
83
- self.context_class(*args) do
101
+ suite_obj = modes_off_suite
102
+ context_class(*args) do
84
103
  suite(suite_obj)
85
- instance_eval(&block) if !block.nil?
104
+ instance_eval(&block) unless block.nil?
86
105
  end
87
106
  end
88
107
 
@@ -91,7 +110,7 @@ module Factory
91
110
  Factory.modes_off_context_class.new(
92
111
  test,
93
112
  test.config,
94
- result_block || proc { |r| }
113
+ result_block || proc{ |r| },
95
114
  )
96
115
  end
97
116
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module MixinStuff
2
4
  def test_mixin_stuff
3
5
  "from mixin"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/stub"
3
5
 
@@ -8,27 +10,25 @@ class Assert::Stub
8
10
 
9
11
  class InstanceTests < SystemTests
10
12
  desc "for instance methods"
11
- subject { instance1 }
13
+ subject{ TestClass.new }
12
14
 
13
15
  setup do
14
- Assert.stub(instance1, :noargs){ "default" }
15
- Assert.stub(instance1, :noargs).with{ "none" }
16
+ Assert.stub(subject, :noargs){ "default" }
17
+ Assert.stub(subject, :noargs).with{ "none" }
16
18
 
17
- Assert.stub(instance1, :withargs){ "default" }
18
- Assert.stub(instance1, :withargs).with(1){ "one" }
19
+ Assert.stub(subject, :withargs){ "default" }
20
+ Assert.stub(subject, :withargs).with(1){ "one" }
19
21
 
20
- Assert.stub(instance1, :anyargs){ "default" }
21
- Assert.stub(instance1, :anyargs).with(1, 2){ "one-two" }
22
+ Assert.stub(subject, :anyargs){ "default" }
23
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
22
24
 
23
- Assert.stub(instance1, :minargs){ "default" }
24
- Assert.stub(instance1, :minargs).with(1, 2){ "one-two" }
25
- Assert.stub(instance1, :minargs).with(1, 2, 3){ "one-two-three" }
25
+ Assert.stub(subject, :minargs){ "default" }
26
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
27
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
26
28
 
27
- Assert.stub(instance1, :withblock){ "default" }
29
+ Assert.stub(subject, :withblock){ "default" }
28
30
  end
29
31
 
30
- let(:instance1) { TestClass.new }
31
-
32
32
  should "allow stubbing a method that doesn't take args" do
33
33
  assert_that(subject.noargs).equals("none")
34
34
  end
@@ -56,53 +56,51 @@ class Assert::Stub
56
56
  end
57
57
 
58
58
  should "not allow stubbing methods with invalid arity" do
59
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).raises
59
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.raises
60
60
 
61
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).raises
62
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).raises
61
+ assert_that{ Assert.stub(subject, :withargs).with{} }.raises
62
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.raises
63
63
 
64
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).raises
65
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).raises
64
+ assert_that{ Assert.stub(subject, :minargs).with{} }.raises
65
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.raises
66
66
 
67
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).raises
67
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.raises
68
68
  end
69
69
 
70
70
  should "not allow calling methods with invalid arity" do
71
- assert_that(-> { subject.noargs(1) }).raises
71
+ assert_that{ subject.noargs(1) }.raises
72
72
 
73
- assert_that(-> { subject.withargs }).raises
74
- assert_that(-> { subject.withargs(1, 2) }).raises
73
+ assert_that{ subject.withargs }.raises
74
+ assert_that{ subject.withargs(1, 2) }.raises
75
75
 
76
- assert_that(-> { subject.minargs }).raises
77
- assert_that(-> { subject.minargs(1) }).raises
76
+ assert_that{ subject.minargs }.raises
77
+ assert_that{ subject.minargs(1) }.raises
78
78
 
79
- assert_that(-> { subject.withblock(1) }).raises
79
+ assert_that{ subject.withblock(1) }.raises
80
80
  end
81
81
  end
82
82
 
83
83
  class ClassTests < SystemTests
84
84
  desc "for singleton methods on a class"
85
- subject { class1 }
85
+ subject{ TestClass }
86
86
 
87
87
  setup do
88
- Assert.stub(class1, :noargs){ "default" }
89
- Assert.stub(class1, :noargs).with{ "none" }
88
+ Assert.stub(subject, :noargs){ "default" }
89
+ Assert.stub(subject, :noargs).with{ "none" }
90
90
 
91
- Assert.stub(class1, :withargs){ "default" }
92
- Assert.stub(class1, :withargs).with(1){ "one" }
91
+ Assert.stub(subject, :withargs){ "default" }
92
+ Assert.stub(subject, :withargs).with(1){ "one" }
93
93
 
94
- Assert.stub(class1, :anyargs){ "default" }
95
- Assert.stub(class1, :anyargs).with(1, 2){ "one-two" }
94
+ Assert.stub(subject, :anyargs){ "default" }
95
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
96
96
 
97
- Assert.stub(class1, :minargs){ "default" }
98
- Assert.stub(class1, :minargs).with(1, 2){ "one-two" }
99
- Assert.stub(class1, :minargs).with(1, 2, 3){ "one-two-three" }
97
+ Assert.stub(subject, :minargs){ "default" }
98
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
99
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
100
100
 
101
- Assert.stub(class1, :withblock){ "default" }
101
+ Assert.stub(subject, :withblock){ "default" }
102
102
  end
103
103
 
104
- let(:class1) { TestClass }
105
-
106
104
  should "allow stubbing a method that doesn't take args" do
107
105
  assert_that(subject.noargs).equals("none")
108
106
  end
@@ -131,53 +129,51 @@ class Assert::Stub
131
129
  end
132
130
 
133
131
  should "not allow stubbing methods with invalid arity" do
134
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).raises
132
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.raises
135
133
 
136
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).raises
137
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).raises
134
+ assert_that{ Assert.stub(subject, :withargs).with{} }.raises
135
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.raises
138
136
 
139
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).raises
140
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).raises
137
+ assert_that{ Assert.stub(subject, :minargs).with{} }.raises
138
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.raises
141
139
 
142
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).raises
140
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.raises
143
141
  end
144
142
 
145
143
  should "not allow calling methods with invalid arity" do
146
- assert_that(-> { subject.noargs(1) }).raises
144
+ assert_that{ subject.noargs(1) }.raises
147
145
 
148
- assert_that(-> { subject.withargs }).raises
149
- assert_that(-> { subject.withargs(1, 2) }).raises
146
+ assert_that{ subject.withargs }.raises
147
+ assert_that{ subject.withargs(1, 2) }.raises
150
148
 
151
- assert_that(-> { subject.minargs }).raises
152
- assert_that(-> { subject.minargs(1) }).raises
149
+ assert_that{ subject.minargs }.raises
150
+ assert_that{ subject.minargs(1) }.raises
153
151
 
154
- assert_that(-> { subject.withblock(1) }).raises
152
+ assert_that{ subject.withblock(1) }.raises
155
153
  end
156
154
  end
157
155
 
158
156
  class ModuleTests < SystemTests
159
157
  desc "for singleton methods on a module"
160
- subject { module1 }
158
+ subject{ TestModule }
161
159
 
162
160
  setup do
163
- Assert.stub(module1, :noargs){ "default" }
164
- Assert.stub(module1, :noargs).with{ "none" }
161
+ Assert.stub(subject, :noargs){ "default" }
162
+ Assert.stub(subject, :noargs).with{ "none" }
165
163
 
166
- Assert.stub(module1, :withargs){ "default" }
167
- Assert.stub(module1, :withargs).with(1){ "one" }
164
+ Assert.stub(subject, :withargs){ "default" }
165
+ Assert.stub(subject, :withargs).with(1){ "one" }
168
166
 
169
- Assert.stub(module1, :anyargs){ "default" }
170
- Assert.stub(module1, :anyargs).with(1, 2){ "one-two" }
167
+ Assert.stub(subject, :anyargs){ "default" }
168
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
171
169
 
172
- Assert.stub(module1, :minargs){ "default" }
173
- Assert.stub(module1, :minargs).with(1, 2){ "one-two" }
174
- Assert.stub(module1, :minargs).with(1, 2, 3){ "one-two-three" }
170
+ Assert.stub(subject, :minargs){ "default" }
171
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
172
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
175
173
 
176
- Assert.stub(module1, :withblock){ "default" }
174
+ Assert.stub(subject, :withblock){ "default" }
177
175
  end
178
176
 
179
- let(:module1) { TestModule }
180
-
181
177
  should "allow stubbing a method that doesn't take args" do
182
178
  assert_that(subject.noargs).equals("none")
183
179
  end
@@ -206,53 +202,51 @@ class Assert::Stub
206
202
  end
207
203
 
208
204
  should "not allow stubbing methods with invalid arity" do
209
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).raises
205
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.raises
210
206
 
211
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).raises
212
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).raises
207
+ assert_that{ Assert.stub(subject, :withargs).with{} }.raises
208
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.raises
213
209
 
214
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).raises
215
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).raises
210
+ assert_that{ Assert.stub(subject, :minargs).with{} }.raises
211
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.raises
216
212
 
217
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).raises
213
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.raises
218
214
  end
219
215
 
220
216
  should "not allow calling methods with invalid arity" do
221
- assert_that(-> { subject.noargs(1) }).raises
217
+ assert_that{ subject.noargs(1) }.raises
222
218
 
223
- assert_that(-> { subject.withargs }).raises
224
- assert_that(-> { subject.withargs(1, 2) }).raises
219
+ assert_that{ subject.withargs }.raises
220
+ assert_that{ subject.withargs(1, 2) }.raises
225
221
 
226
- assert_that(-> { subject.minargs }).raises
227
- assert_that(-> { subject.minargs(1) }).raises
222
+ assert_that{ subject.minargs }.raises
223
+ assert_that{ subject.minargs(1) }.raises
228
224
 
229
- assert_that(-> { subject.withblock(1) }).raises
225
+ assert_that{ subject.withblock(1) }.raises
230
226
  end
231
227
  end
232
228
 
233
229
  class ExtendedTests < SystemTests
234
230
  desc "for extended methods"
235
- subject { class1 }
231
+ subject{ Class.new{ extend TestMixin } }
236
232
 
237
233
  setup do
238
- Assert.stub(class1, :noargs){ "default" }
239
- Assert.stub(class1, :noargs).with{ "none" }
234
+ Assert.stub(subject, :noargs){ "default" }
235
+ Assert.stub(subject, :noargs).with{ "none" }
240
236
 
241
- Assert.stub(class1, :withargs){ "default" }
242
- Assert.stub(class1, :withargs).with(1){ "one" }
237
+ Assert.stub(subject, :withargs){ "default" }
238
+ Assert.stub(subject, :withargs).with(1){ "one" }
243
239
 
244
- Assert.stub(class1, :anyargs){ "default" }
245
- Assert.stub(class1, :anyargs).with(1, 2){ "one-two" }
240
+ Assert.stub(subject, :anyargs){ "default" }
241
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
246
242
 
247
- Assert.stub(class1, :minargs){ "default" }
248
- Assert.stub(class1, :minargs).with(1, 2){ "one-two" }
249
- Assert.stub(class1, :minargs).with(1, 2, 3){ "one-two-three" }
243
+ Assert.stub(subject, :minargs){ "default" }
244
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
245
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
250
246
 
251
- Assert.stub(class1, :withblock){ "default" }
247
+ Assert.stub(subject, :withblock){ "default" }
252
248
  end
253
249
 
254
- let(:class1) { Class.new{ extend TestMixin } }
255
-
256
250
  should "allow stubbing a method that doesn't take args" do
257
251
  assert_that(subject.noargs).equals("none")
258
252
  end
@@ -281,53 +275,53 @@ class Assert::Stub
281
275
  end
282
276
 
283
277
  should "not allow stubbing methods with invalid arity" do
284
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).raises
278
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.raises
285
279
 
286
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).raises
287
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).raises
280
+ assert_that{ Assert.stub(subject, :withargs).with{} }.raises
281
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.raises
288
282
 
289
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).raises
290
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).raises
283
+ assert_that{ Assert.stub(subject, :minargs).with{} }.raises
284
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.raises
291
285
 
292
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).raises
286
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.raises
293
287
  end
294
288
 
295
289
  should "not allow calling methods with invalid arity" do
296
- assert_that(-> { subject.noargs(1) }).raises
290
+ assert_that{ subject.noargs(1) }.raises
297
291
 
298
- assert_that(-> { subject.withargs }).raises
299
- assert_that(-> { subject.withargs(1, 2) }).raises
292
+ assert_that{ subject.withargs }.raises
293
+ assert_that{ subject.withargs(1, 2) }.raises
300
294
 
301
- assert_that(-> { subject.minargs }).raises
302
- assert_that(-> { subject.minargs(1) }).raises
295
+ assert_that{ subject.minargs }.raises
296
+ assert_that{ subject.minargs(1) }.raises
303
297
 
304
- assert_that(-> { subject.withblock(1) }).raises
298
+ assert_that{ subject.withblock(1) }.raises
305
299
  end
306
300
  end
307
301
 
308
302
  class IncludedTests < SystemTests
309
303
  desc "for an included method"
310
- subject { instance1 }
304
+ subject do
305
+ Class.new{ include TestMixin }.new
306
+ end
311
307
 
312
308
  setup do
313
- Assert.stub(instance1, :noargs){ "default" }
314
- Assert.stub(instance1, :noargs).with{ "none" }
309
+ Assert.stub(subject, :noargs){ "default" }
310
+ Assert.stub(subject, :noargs).with{ "none" }
315
311
 
316
- Assert.stub(instance1, :withargs){ "default" }
317
- Assert.stub(instance1, :withargs).with(1){ "one" }
312
+ Assert.stub(subject, :withargs){ "default" }
313
+ Assert.stub(subject, :withargs).with(1){ "one" }
318
314
 
319
- Assert.stub(instance1, :anyargs){ "default" }
320
- Assert.stub(instance1, :anyargs).with(1, 2){ "one-two" }
315
+ Assert.stub(subject, :anyargs){ "default" }
316
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
321
317
 
322
- Assert.stub(instance1, :minargs){ "default" }
323
- Assert.stub(instance1, :minargs).with(1, 2){ "one-two" }
324
- Assert.stub(instance1, :minargs).with(1, 2, 3){ "one-two-three" }
318
+ Assert.stub(subject, :minargs){ "default" }
319
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
320
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
325
321
 
326
- Assert.stub(instance1, :withblock){ "default" }
322
+ Assert.stub(subject, :withblock){ "default" }
327
323
  end
328
324
 
329
- let(:instance1) { Class.new { include TestMixin }.new }
330
-
331
325
  should "allow stubbing a method that doesn't take args" do
332
326
  assert_that(subject.noargs).equals("none")
333
327
  end
@@ -356,53 +350,51 @@ class Assert::Stub
356
350
  end
357
351
 
358
352
  should "not allow stubbing methods with invalid arity" do
359
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).raises
353
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.raises
360
354
 
361
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).raises
362
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).raises
355
+ assert_that{ Assert.stub(subject, :withargs).with{} }.raises
356
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.raises
363
357
 
364
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).raises
365
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).raises
358
+ assert_that{ Assert.stub(subject, :minargs).with{} }.raises
359
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.raises
366
360
 
367
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).raises
361
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.raises
368
362
  end
369
363
 
370
364
  should "not allow calling methods with invalid arity" do
371
- assert_that(-> { subject.noargs(1) }).raises
365
+ assert_that{ subject.noargs(1) }.raises
372
366
 
373
- assert_that(-> { subject.withargs }).raises
374
- assert_that(-> { subject.withargs(1, 2) }).raises
367
+ assert_that{ subject.withargs }.raises
368
+ assert_that{ subject.withargs(1, 2) }.raises
375
369
 
376
- assert_that(-> { subject.minargs }).raises
377
- assert_that(-> { subject.minargs(1) }).raises
370
+ assert_that{ subject.minargs }.raises
371
+ assert_that{ subject.minargs(1) }.raises
378
372
 
379
- assert_that(-> { subject.withblock(1) }).raises
373
+ assert_that{ subject.withblock(1) }.raises
380
374
  end
381
375
  end
382
376
 
383
377
  class InheritedClassTests < SystemTests
384
378
  desc "for an inherited class method"
385
- subject { class1 }
379
+ subject{ Class.new(TestClass) }
386
380
 
387
381
  setup do
388
- Assert.stub(class1, :noargs){ "default" }
389
- Assert.stub(class1, :noargs).with{ "none" }
382
+ Assert.stub(subject, :noargs){ "default" }
383
+ Assert.stub(subject, :noargs).with{ "none" }
390
384
 
391
- Assert.stub(class1, :withargs){ "default" }
392
- Assert.stub(class1, :withargs).with(1){ "one" }
385
+ Assert.stub(subject, :withargs){ "default" }
386
+ Assert.stub(subject, :withargs).with(1){ "one" }
393
387
 
394
- Assert.stub(class1, :anyargs){ "default" }
395
- Assert.stub(class1, :anyargs).with(1, 2){ "one-two" }
388
+ Assert.stub(subject, :anyargs){ "default" }
389
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
396
390
 
397
- Assert.stub(class1, :minargs){ "default" }
398
- Assert.stub(class1, :minargs).with(1, 2){ "one-two" }
399
- Assert.stub(class1, :minargs).with(1, 2, 3){ "one-two-three" }
391
+ Assert.stub(subject, :minargs){ "default" }
392
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
393
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
400
394
 
401
- Assert.stub(class1, :withblock){ "default" }
395
+ Assert.stub(subject, :withblock){ "default" }
402
396
  end
403
397
 
404
- let(:class1) { Class.new(TestClass) }
405
-
406
398
  should "allow stubbing a method that doesn't take args" do
407
399
  assert_that(subject.noargs).equals("none")
408
400
  end
@@ -431,53 +423,51 @@ class Assert::Stub
431
423
  end
432
424
 
433
425
  should "not allow stubbing methods with invalid arity" do
434
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).raises
426
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.raises
435
427
 
436
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).raises
437
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).raises
428
+ assert_that{ Assert.stub(subject, :withargs).with{} }.raises
429
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.raises
438
430
 
439
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).raises
440
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).raises
431
+ assert_that{ Assert.stub(subject, :minargs).with{} }.raises
432
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.raises
441
433
 
442
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).raises
434
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.raises
443
435
  end
444
436
 
445
437
  should "not allow calling methods with invalid arity" do
446
- assert_that(-> { subject.noargs(1) }).raises
438
+ assert_that{ subject.noargs(1) }.raises
447
439
 
448
- assert_that(-> { subject.withargs }).raises
449
- assert_that(-> { subject.withargs(1, 2) }).raises
440
+ assert_that{ subject.withargs }.raises
441
+ assert_that{ subject.withargs(1, 2) }.raises
450
442
 
451
- assert_that(-> { subject.minargs }).raises
452
- assert_that(-> { subject.minargs(1) }).raises
443
+ assert_that{ subject.minargs }.raises
444
+ assert_that{ subject.minargs(1) }.raises
453
445
 
454
- assert_that(-> { subject.withblock(1) }).raises
446
+ assert_that{ subject.withblock(1) }.raises
455
447
  end
456
448
  end
457
449
 
458
450
  class InheritedInstanceTests < SystemTests
459
451
  desc "for an inherited instance method"
460
- subject { instance1 }
452
+ subject{ Class.new(TestClass).new }
461
453
 
462
454
  setup do
463
- Assert.stub(instance1, :noargs){ "default" }
464
- Assert.stub(instance1, :noargs).with{ "none" }
455
+ Assert.stub(subject, :noargs){ "default" }
456
+ Assert.stub(subject, :noargs).with{ "none" }
465
457
 
466
- Assert.stub(instance1, :withargs){ "default" }
467
- Assert.stub(instance1, :withargs).with(1){ "one" }
458
+ Assert.stub(subject, :withargs){ "default" }
459
+ Assert.stub(subject, :withargs).with(1){ "one" }
468
460
 
469
- Assert.stub(instance1, :anyargs){ "default" }
470
- Assert.stub(instance1, :anyargs).with(1, 2){ "one-two" }
461
+ Assert.stub(subject, :anyargs){ "default" }
462
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
471
463
 
472
- Assert.stub(instance1, :minargs){ "default" }
473
- Assert.stub(instance1, :minargs).with(1, 2){ "one-two" }
474
- Assert.stub(instance1, :minargs).with(1, 2, 3){ "one-two-three" }
464
+ Assert.stub(subject, :minargs){ "default" }
465
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
466
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
475
467
 
476
- Assert.stub(instance1, :withblock){ "default" }
468
+ Assert.stub(subject, :withblock){ "default" }
477
469
  end
478
470
 
479
- let(:instance1) { Class.new(TestClass).new }
480
-
481
471
  should "allow stubbing a method that doesn't take args" do
482
472
  assert_that(subject.noargs).equals("none")
483
473
  end
@@ -506,53 +496,51 @@ class Assert::Stub
506
496
  end
507
497
 
508
498
  should "not allow stubbing methods with invalid arity" do
509
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).raises
499
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.raises
510
500
 
511
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).raises
512
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).raises
501
+ assert_that{ Assert.stub(subject, :withargs).with{} }.raises
502
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.raises
513
503
 
514
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).raises
515
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).raises
504
+ assert_that{ Assert.stub(subject, :minargs).with{} }.raises
505
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.raises
516
506
 
517
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).raises
507
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.raises
518
508
  end
519
509
 
520
510
  should "not allow calling methods with invalid arity" do
521
- assert_that(-> { subject.noargs(1) }).raises
511
+ assert_that{ subject.noargs(1) }.raises
522
512
 
523
- assert_that(-> { subject.withargs }).raises
524
- assert_that(-> { subject.withargs(1, 2) }).raises
513
+ assert_that{ subject.withargs }.raises
514
+ assert_that{ subject.withargs(1, 2) }.raises
525
515
 
526
- assert_that(-> { subject.minargs }).raises
527
- assert_that(-> { subject.minargs(1) }).raises
516
+ assert_that{ subject.minargs }.raises
517
+ assert_that{ subject.minargs(1) }.raises
528
518
 
529
- assert_that(-> { subject.withblock(1) }).raises
519
+ assert_that{ subject.withblock(1) }.raises
530
520
  end
531
521
  end
532
522
 
533
523
  class DelegateClassTests < SystemTests
534
524
  desc "a class that delegates another object"
535
- subject { class1 }
525
+ subject{ DelegateClass }
536
526
 
537
527
  setup do
538
- Assert.stub(class1, :noargs){ "default" }
539
- Assert.stub(class1, :noargs).with{ "none" }
528
+ Assert.stub(subject, :noargs){ "default" }
529
+ Assert.stub(subject, :noargs).with{ "none" }
540
530
 
541
- Assert.stub(class1, :withargs){ "default" }
542
- Assert.stub(class1, :withargs).with(1){ "one" }
531
+ Assert.stub(subject, :withargs){ "default" }
532
+ Assert.stub(subject, :withargs).with(1){ "one" }
543
533
 
544
- Assert.stub(class1, :anyargs){ "default" }
545
- Assert.stub(class1, :anyargs).with(1, 2){ "one-two" }
534
+ Assert.stub(subject, :anyargs){ "default" }
535
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
546
536
 
547
- Assert.stub(class1, :minargs){ "default" }
548
- Assert.stub(class1, :minargs).with(1, 2){ "one-two" }
549
- Assert.stub(class1, :minargs).with(1, 2, 3){ "one-two-three" }
537
+ Assert.stub(subject, :minargs){ "default" }
538
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
539
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
550
540
 
551
- Assert.stub(class1, :withblock){ "default" }
541
+ Assert.stub(subject, :withblock){ "default" }
552
542
  end
553
543
 
554
- let(:class1) { DelegateClass }
555
-
556
544
  should "allow stubbing a method that doesn't take args" do
557
545
  assert_that(subject.noargs).equals("none")
558
546
  end
@@ -581,53 +569,51 @@ class Assert::Stub
581
569
  end
582
570
 
583
571
  should "allow stubbing methods with invalid arity" do
584
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).does_not_raise
572
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.does_not_raise
585
573
 
586
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).does_not_raise
587
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).does_not_raise
574
+ assert_that{ Assert.stub(subject, :withargs).with{} }.does_not_raise
575
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.does_not_raise
588
576
 
589
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).does_not_raise
590
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).does_not_raise
577
+ assert_that{ Assert.stub(subject, :minargs).with{} }.does_not_raise
578
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.does_not_raise
591
579
 
592
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).does_not_raise
580
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.does_not_raise
593
581
  end
594
582
 
595
583
  should "allow calling methods with invalid arity" do
596
- assert_that(-> { subject.noargs(1) }).does_not_raise
584
+ assert_that{ subject.noargs(1) }.does_not_raise
597
585
 
598
- assert_that(-> { subject.withargs }).does_not_raise
599
- assert_that(-> { subject.withargs(1, 2) }).does_not_raise
586
+ assert_that{ subject.withargs }.does_not_raise
587
+ assert_that{ subject.withargs(1, 2) }.does_not_raise
600
588
 
601
- assert_that(-> { subject.minargs }).does_not_raise
602
- assert_that(-> { subject.minargs(1) }).does_not_raise
589
+ assert_that{ subject.minargs }.does_not_raise
590
+ assert_that{ subject.minargs(1) }.does_not_raise
603
591
 
604
- assert_that(-> { subject.withblock(1) }).does_not_raise
592
+ assert_that{ subject.withblock(1) }.does_not_raise
605
593
  end
606
594
  end
607
595
 
608
596
  class DelegateInstanceTests < SystemTests
609
597
  desc "an instance that delegates another object"
610
- subject { instance1 }
598
+ subject{ DelegateClass.new }
611
599
 
612
600
  setup do
613
- Assert.stub(instance1, :noargs){ "default" }
614
- Assert.stub(instance1, :noargs).with{ "none" }
601
+ Assert.stub(subject, :noargs){ "default" }
602
+ Assert.stub(subject, :noargs).with{ "none" }
615
603
 
616
- Assert.stub(instance1, :withargs){ "default" }
617
- Assert.stub(instance1, :withargs).with(1){ "one" }
604
+ Assert.stub(subject, :withargs){ "default" }
605
+ Assert.stub(subject, :withargs).with(1){ "one" }
618
606
 
619
- Assert.stub(instance1, :anyargs){ "default" }
620
- Assert.stub(instance1, :anyargs).with(1, 2){ "one-two" }
607
+ Assert.stub(subject, :anyargs){ "default" }
608
+ Assert.stub(subject, :anyargs).with(1, 2){ "one-two" }
621
609
 
622
- Assert.stub(instance1, :minargs){ "default" }
623
- Assert.stub(instance1, :minargs).with(1, 2){ "one-two" }
624
- Assert.stub(instance1, :minargs).with(1, 2, 3){ "one-two-three" }
610
+ Assert.stub(subject, :minargs){ "default" }
611
+ Assert.stub(subject, :minargs).with(1, 2){ "one-two" }
612
+ Assert.stub(subject, :minargs).with(1, 2, 3){ "one-two-three" }
625
613
 
626
- Assert.stub(instance1, :withblock){ "default" }
614
+ Assert.stub(subject, :withblock){ "default" }
627
615
  end
628
616
 
629
- let(:instance1) { DelegateClass.new }
630
-
631
617
  should "allow stubbing a method that doesn't take args" do
632
618
  assert_that(subject.noargs).equals("none")
633
619
  end
@@ -656,27 +642,27 @@ class Assert::Stub
656
642
  end
657
643
 
658
644
  should "allow stubbing methods with invalid arity" do
659
- assert_that(-> { Assert.stub(subject, :noargs).with(1){ } }).does_not_raise
645
+ assert_that{ Assert.stub(subject, :noargs).with(1){} }.does_not_raise
660
646
 
661
- assert_that(-> { Assert.stub(subject, :withargs).with{ } }).does_not_raise
662
- assert_that(-> { Assert.stub(subject, :withargs).with(1, 2){ } }).does_not_raise
647
+ assert_that{ Assert.stub(subject, :withargs).with{} }.does_not_raise
648
+ assert_that{ Assert.stub(subject, :withargs).with(1, 2){} }.does_not_raise
663
649
 
664
- assert_that(-> { Assert.stub(subject, :minargs).with{ } }).does_not_raise
665
- assert_that(-> { Assert.stub(subject, :minargs).with(1){ } }).does_not_raise
650
+ assert_that{ Assert.stub(subject, :minargs).with{} }.does_not_raise
651
+ assert_that{ Assert.stub(subject, :minargs).with(1){} }.does_not_raise
666
652
 
667
- assert_that(-> { Assert.stub(subject, :withblock).with(1){ } }).does_not_raise
653
+ assert_that{ Assert.stub(subject, :withblock).with(1){} }.does_not_raise
668
654
  end
669
655
 
670
656
  should "allow calling methods with invalid arity" do
671
- assert_that(-> { subject.noargs(1) }).does_not_raise
657
+ assert_that{ subject.noargs(1) }.does_not_raise
672
658
 
673
- assert_that(-> { subject.withargs }).does_not_raise
674
- assert_that(-> { subject.withargs(1, 2) }).does_not_raise
659
+ assert_that{ subject.withargs }.does_not_raise
660
+ assert_that{ subject.withargs(1, 2) }.does_not_raise
675
661
 
676
- assert_that(-> { subject.minargs }).does_not_raise
677
- assert_that(-> { subject.minargs(1) }).does_not_raise
662
+ assert_that{ subject.minargs }.does_not_raise
663
+ assert_that{ subject.minargs(1) }.does_not_raise
678
664
 
679
- assert_that(-> { subject.withblock(1) }).does_not_raise
665
+ assert_that{ subject.withblock(1) }.does_not_raise
680
666
  end
681
667
  end
682
668
 
@@ -687,8 +673,8 @@ class Assert::Stub
687
673
  Assert.stub(child_class, :new){ "child" }
688
674
  end
689
675
 
690
- let(:parent_class) { Class.new }
691
- let(:child_class) { Class.new(parent_class) }
676
+ let(:parent_class){ Class.new }
677
+ let(:child_class){ Class.new(parent_class) }
692
678
 
693
679
  should "allow stubbing the methods individually" do
694
680
  assert_that(parent_class.new).equals("parent")
@@ -697,37 +683,73 @@ class Assert::Stub
697
683
  end
698
684
 
699
685
  class TestClass
700
- def self.noargs; end
701
- def self.withargs(a); end
702
- def self.anyargs(*args); end
703
- def self.minargs(a, b, *args); end
704
- def self.withblock(&block); end
705
-
706
- def noargs; end
707
- def withargs(a); end
708
- def anyargs(*args); end
709
- def minargs(a, b, *args); end
710
- def withblock(&block); end
686
+ def self.noargs
687
+ end
688
+
689
+ def self.withargs(a)
690
+ end
691
+
692
+ def self.anyargs(*args)
693
+ end
694
+
695
+ def self.minargs(a, b, *args)
696
+ end
697
+
698
+ def self.withblock(&block)
699
+ end
700
+
701
+ def noargs
702
+ end
703
+
704
+ def withargs(a)
705
+ end
706
+
707
+ def anyargs(*args)
708
+ end
709
+
710
+ def minargs(a, b, *args)
711
+ end
712
+
713
+ def withblock(&block)
714
+ end
711
715
  end
712
716
 
713
717
  module TestModule
714
- def self.noargs; end
715
- def self.withargs(a); end
716
- def self.anyargs(*args); end
717
- def self.minargs(a, b, *args); end
718
- def self.withblock(&block); end
718
+ def self.noargs
719
+ end
720
+
721
+ def self.withargs(a)
722
+ end
723
+
724
+ def self.anyargs(*args)
725
+ end
726
+
727
+ def self.minargs(a, b, *args)
728
+ end
729
+
730
+ def self.withblock(&block)
731
+ end
719
732
  end
720
733
 
721
734
  module TestMixin
722
- def noargs; end
723
- def withargs(a); end
724
- def anyargs(*args); end
725
- def minargs(a, b, *args); end
726
- def withblock(&block); end
735
+ def noargs
736
+ end
737
+
738
+ def withargs(a)
739
+ end
740
+
741
+ def anyargs(*args)
742
+ end
743
+
744
+ def minargs(a, b, *args)
745
+ end
746
+
747
+ def withblock(&block)
748
+ end
727
749
  end
728
750
 
729
751
  class DelegateClass
730
- def self.respond_to?(*args)
752
+ def self.respond_to_missing?(*args)
731
753
  TestClass.respond_to?(*args) || super
732
754
  end
733
755
 
@@ -739,7 +761,7 @@ class Assert::Stub
739
761
  @delegate = TestClass.new
740
762
  end
741
763
 
742
- def respond_to?(*args)
764
+ def respond_to_missing?(*args)
743
765
  @delegate.respond_to?(*args) || super
744
766
  end
745
767