rubocop-rspec 1.33.0 → 1.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -2
  3. data/README.md +10 -2
  4. data/config/default.yml +6 -1
  5. data/lib/rubocop/cop/rspec/any_instance.rb +0 -1
  6. data/lib/rubocop/cop/rspec/around_block.rb +1 -2
  7. data/lib/rubocop/cop/rspec/before_after_all.rb +0 -1
  8. data/lib/rubocop/cop/rspec/context_wording.rb +18 -17
  9. data/lib/rubocop/cop/rspec/describe_class.rb +1 -1
  10. data/lib/rubocop/cop/rspec/describe_method.rb +1 -1
  11. data/lib/rubocop/cop/rspec/describe_symbol.rb +1 -1
  12. data/lib/rubocop/cop/rspec/described_class.rb +79 -13
  13. data/lib/rubocop/cop/rspec/empty_example_group.rb +1 -1
  14. data/lib/rubocop/cop/rspec/empty_line_after_subject.rb +1 -1
  15. data/lib/rubocop/cop/rspec/example_length.rb +1 -1
  16. data/lib/rubocop/cop/rspec/example_wording.rb +6 -4
  17. data/lib/rubocop/cop/rspec/expect_actual.rb +1 -1
  18. data/lib/rubocop/cop/rspec/expect_output.rb +2 -0
  19. data/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb +1 -1
  20. data/lib/rubocop/cop/rspec/factory_bot/create_list.rb +1 -2
  21. data/lib/rubocop/cop/rspec/file_path.rb +0 -1
  22. data/lib/rubocop/cop/rspec/focus.rb +1 -1
  23. data/lib/rubocop/cop/rspec/hook_argument.rb +0 -1
  24. data/lib/rubocop/cop/rspec/instance_spy.rb +1 -1
  25. data/lib/rubocop/cop/rspec/instance_variable.rb +1 -1
  26. data/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb +1 -1
  27. data/lib/rubocop/cop/rspec/it_behaves_like.rb +1 -1
  28. data/lib/rubocop/cop/rspec/iterated_expectation.rb +1 -1
  29. data/lib/rubocop/cop/rspec/leading_subject.rb +0 -1
  30. data/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +128 -0
  31. data/lib/rubocop/cop/rspec/let_before_examples.rb +1 -1
  32. data/lib/rubocop/cop/rspec/let_setup.rb +2 -4
  33. data/lib/rubocop/cop/rspec/missing_example_group_argument.rb +1 -2
  34. data/lib/rubocop/cop/rspec/multiple_describes.rb +1 -1
  35. data/lib/rubocop/cop/rspec/multiple_expectations.rb +32 -16
  36. data/lib/rubocop/cop/rspec/multiple_subjects.rb +1 -1
  37. data/lib/rubocop/cop/rspec/nested_groups.rb +0 -1
  38. data/lib/rubocop/cop/rspec/overwriting_setup.rb +0 -1
  39. data/lib/rubocop/cop/rspec/pending.rb +1 -1
  40. data/lib/rubocop/cop/rspec/predicate_matcher.rb +0 -3
  41. data/lib/rubocop/cop/rspec/repeated_description.rb +1 -1
  42. data/lib/rubocop/cop/rspec/repeated_example.rb +1 -1
  43. data/lib/rubocop/cop/rspec/scattered_let.rb +1 -1
  44. data/lib/rubocop/cop/rspec/scattered_setup.rb +1 -1
  45. data/lib/rubocop/cop/rspec/shared_context.rb +0 -1
  46. data/lib/rubocop/cop/rspec/single_argument_message_chain.rb +1 -1
  47. data/lib/rubocop/cop/rspec/subject_stub.rb +17 -20
  48. data/lib/rubocop/cop/rspec/unspecified_exception.rb +1 -4
  49. data/lib/rubocop/cop/rspec/verified_doubles.rb +1 -1
  50. data/lib/rubocop/cop/rspec/void_expect.rb +1 -1
  51. data/lib/rubocop/cop/rspec_cops.rb +1 -0
  52. data/lib/rubocop/rspec/language.rb +1 -1
  53. data/lib/rubocop/rspec/top_level_describe.rb +0 -4
  54. data/lib/rubocop/rspec/version.rb +1 -1
  55. data/spec/rubocop/cop/rspec/cop_spec.rb +3 -3
  56. data/spec/rubocop/cop/rspec/describe_class_spec.rb +7 -0
  57. data/spec/rubocop/cop/rspec/described_class_spec.rb +113 -80
  58. data/spec/rubocop/cop/rspec/example_wording_spec.rb +33 -0
  59. data/spec/rubocop/cop/rspec/leaky_constant_declaration_spec.rb +91 -0
  60. data/spec/rubocop/cop/rspec/let_setup_spec.rb +2 -2
  61. data/spec/rubocop/cop/rspec/multiple_expectations_spec.rb +64 -37
  62. data/spec/rubocop/cop/rspec/subject_stub_spec.rb +113 -14
  63. data/spec/rubocop/rspec/language/selector_set_spec.rb +2 -2
  64. metadata +5 -2
@@ -101,7 +101,6 @@ module RuboCop
101
101
  def add_shared_item_offense(node, message)
102
102
  add_offense(
103
103
  node,
104
- location: :expression,
105
104
  message: message
106
105
  )
107
106
  end
@@ -75,7 +75,7 @@ module RuboCop
75
75
  end
76
76
 
77
77
  def key_to_arg(node)
78
- key, = *node
78
+ key, = *node # rubocop:disable InternalAffairs/NodeDestructuring
79
79
  node.sym_type? ? ":#{key}" : node.source
80
80
  end
81
81
 
@@ -6,6 +6,8 @@ module RuboCop
6
6
  # Checks for stubbed test subjects.
7
7
  #
8
8
  # @see https://robots.thoughtbot.com/don-t-stub-the-system-under-test
9
+ # @see https://samphippen.com/introducing-rspec-smells-and-where-to-find-them#smell-1-stubject
10
+ # @see https://github.com/rubocop-hq/rspec-style-guide#dont-stub-subject
9
11
  #
10
12
  # @example
11
13
  # # bad
@@ -18,9 +20,7 @@ module RuboCop
18
20
  # end
19
21
  #
20
22
  class SubjectStub < Cop
21
- include RuboCop::RSpec::TopLevelDescribe
22
-
23
- MSG = 'Do not stub your test subject.'
23
+ MSG = 'Do not stub methods of the object under test.'
24
24
 
25
25
  # @!method subject(node)
26
26
  # Find a named or unnamed subject definition
@@ -56,31 +56,28 @@ module RuboCop
56
56
  # expect(foo).to receive(:bar).with(1)
57
57
  # expect(foo).to receive(:bar).with(1).and_return(2)
58
58
  #
59
- # @example source that not matches
60
- # expect(foo).to all(receive(:bar))
61
- #
62
59
  def_node_matcher :message_expectation?, <<-PATTERN
63
- {
64
- (send nil? :allow (send nil? %))
65
- (send (send nil? :expect (send nil? %)) :to #expectation?)
66
- }
60
+ (send
61
+ {
62
+ (send nil? { :expect :allow } (send nil? {% :subject}))
63
+ (send nil? :is_expected)
64
+ }
65
+ #{Runners::ALL.node_pattern_union}
66
+ #message_expectation_matcher?
67
+ )
67
68
  PATTERN
68
69
 
69
- def_node_matcher :all_matcher?, '(send nil? :all ...)'
70
-
71
- def_node_search :receive_message?, '(send nil? :receive ...)'
72
-
73
- def expectation?(node)
74
- return if all_matcher?(node)
75
-
76
- receive_message?(node)
77
- end
70
+ def_node_search :message_expectation_matcher?, <<-PATTERN
71
+ (send nil? {
72
+ :receive :receive_messages :receive_message_chain :have_received
73
+ } ...)
74
+ PATTERN
78
75
 
79
76
  def on_block(node)
80
77
  return unless example_group?(node)
81
78
 
82
79
  find_subject_stub(node) do |stub|
83
- add_offense(stub, location: :expression)
80
+ add_offense(stub)
84
81
  end
85
82
  end
86
83
 
@@ -45,10 +45,7 @@ module RuboCop
45
45
  def on_send(node)
46
46
  return unless empty_exception_matcher?(node)
47
47
 
48
- add_offense(
49
- node.children.last,
50
- location: :expression
51
- )
48
+ add_offense(node.children.last)
52
49
  end
53
50
 
54
51
  def empty_exception_matcher?(node)
@@ -34,7 +34,7 @@ module RuboCop
34
34
  return if name.nil? && cop_config['IgnoreNameless']
35
35
  return if symbol?(name) && cop_config['IgnoreSymbolicNames']
36
36
 
37
- add_offense(node, location: :expression)
37
+ add_offense(node)
38
38
  end
39
39
  end
40
40
 
@@ -40,7 +40,7 @@ module RuboCop
40
40
  def check_expect(node)
41
41
  return unless void?(node)
42
42
 
43
- add_offense(node, location: :expression)
43
+ add_offense(node)
44
44
  end
45
45
 
46
46
  def void?(expect)
@@ -49,6 +49,7 @@ require_relative 'rspec/invalid_predicate_matcher'
49
49
  require_relative 'rspec/it_behaves_like'
50
50
  require_relative 'rspec/iterated_expectation'
51
51
  require_relative 'rspec/leading_subject'
52
+ require_relative 'rspec/leaky_constant_declaration'
52
53
  require_relative 'rspec/let_before_examples'
53
54
  require_relative 'rspec/let_setup'
54
55
  require_relative 'rspec/message_chain'
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # RSpec public API methods that are commonly used in cops
6
6
  module Language
7
- RSPEC = '{(const nil? :RSpec) nil?}'
7
+ RSPEC = '{(const {nil? cbase} :RSpec) nil?}'
8
8
 
9
9
  # Set of method selectors
10
10
  class SelectorSet
@@ -6,10 +6,6 @@ module RuboCop
6
6
  module TopLevelDescribe
7
7
  extend NodePattern::Macros
8
8
 
9
- def_node_matcher :described_constant, <<-PATTERN
10
- (block $(send _ :describe $(const ...)) (args) $_)
11
- PATTERN
12
-
13
9
  def on_send(node)
14
10
  return unless respond_to?(:on_top_level_describe)
15
11
  return unless top_level_describe?(node)
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module RSpec
5
5
  # Version information for the RSpec RuboCop plugin.
6
6
  module Version
7
- STRING = '1.33.0'
7
+ STRING = '1.34.0'
8
8
  end
9
9
  end
10
10
  end
@@ -21,13 +21,13 @@ RSpec.describe RuboCop::Cop::RSpec::Cop do
21
21
 
22
22
  let(:fake_cop) do
23
23
  stub_const('RuboCop::RSpec', Module.new)
24
- # rubocop:disable ClassAndModuleChildren
24
+ # rubocop:disable ClassAndModuleChildren, RSpec/LeakyConstantDeclaration
25
25
  class RuboCop::RSpec::FakeCop < described_class
26
26
  def on_send(node)
27
- add_offense(node, location: :expression, message: 'I flag everything')
27
+ add_offense(node, message: 'I flag everything')
28
28
  end
29
29
  end
30
- # rubocop:enable ClassAndModuleChildren
30
+ # rubocop:enable ClassAndModuleChildren, RSpec/LeakyConstantDeclaration
31
31
  RuboCop::RSpec::FakeCop
32
32
  end
33
33
 
@@ -18,6 +18,13 @@ RSpec.describe RuboCop::Cop::RSpec::DescribeClass do
18
18
  RUBY
19
19
  end
20
20
 
21
+ it 'supports ::RSpec.describe' do
22
+ expect_no_offenses(<<-RUBY)
23
+ ::RSpec.describe Foo do
24
+ end
25
+ RUBY
26
+ end
27
+
21
28
  it 'checks describe statements after a require' do
22
29
  expect_offense(<<-RUBY)
23
30
  require 'spec_helper'
@@ -3,12 +3,12 @@
3
3
  RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
4
4
  subject(:cop) { described_class.new(config) }
5
5
 
6
- let(:cop_config) do
7
- { 'EnforcedStyle' => enforced_style }
8
- end
6
+ let(:cop_config) { {} }
7
+
8
+ context 'when SkipBlocks is `true`' do
9
+ let(:cop_config) { { 'SkipBlocks' => true } }
9
10
 
10
- shared_examples 'SkipBlocks enabled' do
11
- it 'does not flag violations within non-rspec blocks' do
11
+ it 'ignores violations within non-rspec blocks' do
12
12
  expect_offense(<<-RUBY)
13
13
  describe MyClass do
14
14
  controller(ApplicationController) do
@@ -28,7 +28,7 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
28
28
  end
29
29
  end
30
30
 
31
- shared_examples 'SkipBlocks disabled' do
31
+ context 'when SkipBlocks is `false`' do
32
32
  it 'flags violations within all blocks' do
33
33
  expect_offense(<<-RUBY)
34
34
  describe MyClass do
@@ -37,7 +37,7 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
37
37
  ^^^^^^^ Use `described_class` instead of `MyClass`.
38
38
  end
39
39
 
40
- before(:each) do
40
+ before do
41
41
  MyClass
42
42
  ^^^^^^^ Use `described_class` instead of `MyClass`.
43
43
 
@@ -51,34 +51,10 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
51
51
  end
52
52
  end
53
53
 
54
- context 'when SkipBlocks is `true`' do
55
- let(:cop_config) { { 'SkipBlocks' => true } }
56
-
57
- include_examples 'SkipBlocks enabled'
58
- end
59
-
60
- context 'when SkipBlocks anything besides `true`' do
61
- let(:cop_config) { { 'SkipBlocks' => 'yes' } }
62
-
63
- include_examples 'SkipBlocks disabled'
64
- end
65
-
66
- context 'when SkipBlocks is not set' do
67
- let(:cop_config) { {} }
68
-
69
- include_examples 'SkipBlocks disabled'
70
- end
71
-
72
- context 'when SkipBlocks is `false`' do
73
- let(:cop_config) { { 'SkipBlocks' => false } }
74
-
75
- include_examples 'SkipBlocks disabled'
76
- end
77
-
78
54
  context 'when EnforcedStyle is :described_class' do
79
- let(:enforced_style) { :described_class }
55
+ let(:cop_config) { { 'EnforcedStyle' => :described_class } }
80
56
 
81
- it 'checks for the use of the described class' do
57
+ it 'flags for the use of the described class' do
82
58
  expect_offense(<<-RUBY)
83
59
  describe MyClass do
84
60
  include MyClass
@@ -91,6 +67,25 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
91
67
  ^^^^^^^ Use `described_class` instead of `MyClass`.
92
68
  end
93
69
  RUBY
70
+
71
+ expect_correction(<<-RUBY)
72
+ describe MyClass do
73
+ include described_class
74
+
75
+ subject { described_class.do_something }
76
+
77
+ before { described_class.do_something }
78
+ end
79
+ RUBY
80
+ end
81
+
82
+ it 'flags with metadata' do
83
+ expect_offense(<<-RUBY)
84
+ describe MyClass, some: :metadata do
85
+ subject { MyClass }
86
+ ^^^^^^^ Use `described_class` instead of `MyClass`.
87
+ end
88
+ RUBY
94
89
  end
95
90
 
96
91
  it 'ignores described class as string' do
@@ -131,14 +126,14 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
131
126
  RUBY
132
127
  end
133
128
 
134
- it 'only takes class from top level describes' do
129
+ it 'takes class from innermost describe' do
135
130
  expect_offense(<<-RUBY)
136
131
  describe MyClass do
137
132
  describe MyClass::Foo do
138
133
  subject { MyClass::Foo }
134
+ ^^^^^^^^^^^^ Use `described_class` instead of `MyClass::Foo`.
139
135
 
140
136
  let(:foo) { MyClass }
141
- ^^^^^^^ Use `described_class` instead of `MyClass`.
142
137
  end
143
138
  end
144
139
  RUBY
@@ -152,7 +147,7 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
152
147
  RUBY
153
148
  end
154
149
 
155
- it 'ignores if namespace is not matching' do
150
+ it 'ignores non-matching namespace defined on `describe` level' do
156
151
  expect_no_offenses(<<-RUBY)
157
152
  describe MyNamespace::MyClass do
158
153
  subject { ::MyClass }
@@ -161,7 +156,17 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
161
156
  RUBY
162
157
  end
163
158
 
164
- it 'checks for the use of described class with namespace' do
159
+ it 'ignores non-matching namespace' do
160
+ expect_no_offenses(<<-RUBY)
161
+ module MyNamespace
162
+ describe MyClass do
163
+ subject { ::MyClass }
164
+ end
165
+ end
166
+ RUBY
167
+ end
168
+
169
+ it 'flags the use of described class with namespace' do
165
170
  expect_offense(<<-RUBY)
166
171
  describe MyNamespace::MyClass do
167
172
  subject { MyNamespace::MyClass }
@@ -170,7 +175,17 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
170
175
  RUBY
171
176
  end
172
177
 
173
- it 'does not flag violations within a class scope change' do
178
+ it 'ignores non-matching namespace in usages' do
179
+ expect_no_offenses(<<-RUBY)
180
+ module UnrelatedNamespace
181
+ describe MyClass do
182
+ subject { MyNamespace::MyClass }
183
+ end
184
+ end
185
+ RUBY
186
+ end
187
+
188
+ it 'ignores violations within a class scope change' do
174
189
  expect_no_offenses(<<-RUBY)
175
190
  describe MyNamespace::MyClass do
176
191
  before do
@@ -182,7 +197,7 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
182
197
  RUBY
183
198
  end
184
199
 
185
- it 'does not flag violations within a hook scope change' do
200
+ it 'ignores violations within a hook scope change' do
186
201
  expect_no_offenses(<<-RUBY)
187
202
  describe do
188
203
  before do
@@ -192,17 +207,46 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
192
207
  RUBY
193
208
  end
194
209
 
195
- it 'checks for the use of described class with module' do
196
- pending
197
-
210
+ it 'flags the use of described class with module' do
198
211
  expect_offense(<<-RUBY)
199
212
  module MyNamespace
200
213
  describe MyClass do
201
214
  subject { MyNamespace::MyClass }
202
- ^^^^^^^^^^^^^^^^^^^^ Use `described_class` instead of `MyNamespace::MyClass`
215
+ ^^^^^^^^^^^^^^^^^^^^ Use `described_class` instead of `MyNamespace::MyClass`.
203
216
  end
204
217
  end
205
218
  RUBY
219
+
220
+ expect_correction(<<-RUBY)
221
+ module MyNamespace
222
+ describe MyClass do
223
+ subject { described_class }
224
+ end
225
+ end
226
+ RUBY
227
+ end
228
+
229
+ it 'flags the use of described class with nested namespace' do
230
+ expect_offense(<<-RUBY)
231
+ module A
232
+ class B::C
233
+ module D
234
+ describe E do
235
+ subject { A::B::C::D::E }
236
+ ^^^^^^^^^^^^^ Use `described_class` instead of `A::B::C::D::E`.
237
+ let(:one) { B::C::D::E }
238
+ ^^^^^^^^^^ Use `described_class` instead of `B::C::D::E`.
239
+ let(:two) { C::D::E }
240
+ ^^^^^^^ Use `described_class` instead of `C::D::E`.
241
+ let(:six) { D::E }
242
+ ^^^^ Use `described_class` instead of `D::E`.
243
+ let(:ten) { E }
244
+ ^ Use `described_class` instead of `E`.
245
+ end
246
+ end
247
+ end
248
+ end
249
+ RUBY
206
250
  end
207
251
 
208
252
  it 'accepts an empty block' do
@@ -211,24 +255,12 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
211
255
  end
212
256
  RUBY
213
257
  end
214
-
215
- include_examples 'autocorrect',
216
- 'describe(Foo) { include Foo }',
217
- 'describe(Foo) { include described_class }'
218
-
219
- include_examples 'autocorrect',
220
- 'describe(Foo) { subject { Foo.do_action } }',
221
- 'describe(Foo) { subject { described_class.do_action } }'
222
-
223
- include_examples 'autocorrect',
224
- 'describe(Foo) { before { Foo.do_action } }',
225
- 'describe(Foo) { before { described_class.do_action } }'
226
258
  end
227
259
 
228
260
  context 'when EnforcedStyle is :explicit' do
229
- let(:enforced_style) { :explicit }
261
+ let(:cop_config) { { 'EnforcedStyle' => :explicit } }
230
262
 
231
- it 'checks for the use of the described_class' do
263
+ it 'flags the use of the described_class' do
232
264
  expect_offense(<<-RUBY)
233
265
  describe MyClass do
234
266
  include described_class
@@ -241,6 +273,16 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
241
273
  ^^^^^^^^^^^^^^^ Use `MyClass` instead of `described_class`.
242
274
  end
243
275
  RUBY
276
+
277
+ expect_correction(<<-RUBY)
278
+ describe MyClass do
279
+ include MyClass
280
+
281
+ subject { MyClass.do_something }
282
+
283
+ before { MyClass.do_something }
284
+ end
285
+ RUBY
244
286
  end
245
287
 
246
288
  it 'ignores described_class as string' do
@@ -259,7 +301,7 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
259
301
  RUBY
260
302
  end
261
303
 
262
- it 'does not flag violations within a class scope change' do
304
+ it 'ignores violations within a class scope change' do
263
305
  expect_no_offenses(<<-RUBY)
264
306
  describe MyNamespace::MyClass do
265
307
  before do
@@ -271,7 +313,7 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
271
313
  RUBY
272
314
  end
273
315
 
274
- it 'does not flag violations within a hook scope change' do
316
+ it 'ignores violations within a hook scope change' do
275
317
  expect_no_offenses(<<-RUBY)
276
318
  describe do
277
319
  before do
@@ -281,27 +323,18 @@ RSpec.describe RuboCop::Cop::RSpec::DescribedClass, :config do
281
323
  RUBY
282
324
  end
283
325
 
284
- include_examples 'autocorrect',
285
- 'describe(Foo) { include described_class }',
286
- 'describe(Foo) { include Foo }'
287
-
288
- include_examples 'autocorrect',
289
- 'describe(Foo) { subject { described_class.do_action } }',
290
- 'describe(Foo) { subject { Foo.do_action } }'
291
-
292
- include_examples 'autocorrect',
293
- 'describe(Foo) { before { described_class.do_action } }',
294
- 'describe(Foo) { before { Foo.do_action } }'
295
-
296
- original = <<-RUBY
297
- describe(Foo) { include described_class }
298
- describe(Bar) { include described_class }
299
- RUBY
300
- corrected = <<-RUBY
301
- describe(Foo) { include Foo }
302
- describe(Bar) { include Bar }
303
- RUBY
326
+ it 'autocorrects corresponding' do
327
+ expect_offense(<<-RUBY)
328
+ describe(Foo) { include described_class }
329
+ ^^^^^^^^^^^^^^^ Use `Foo` instead of `described_class`.
330
+ describe(Bar) { include described_class }
331
+ ^^^^^^^^^^^^^^^ Use `Bar` instead of `described_class`.
332
+ RUBY
304
333
 
305
- include_examples 'autocorrect', original, corrected
334
+ expect_correction(<<-RUBY)
335
+ describe(Foo) { include Foo }
336
+ describe(Bar) { include Bar }
337
+ RUBY
338
+ end
306
339
  end
307
340
  end