Skip to content
This repository
Browse code

move top-level modules to RSpec::Rails namespace

  • Loading branch information...
commit a6a35a67c4d1ac2e5274dedae9f92c8049abc9b3 1 parent b39e5fd
David Chelimsky dchelimsky authored
44 lib/rspec/rails/example/controller_example_group.rb
... ... @@ -1,33 +1,35 @@
1 1 require 'action_controller'
2 2 require 'webrat'
3 3
4   -module ControllerExampleGroupBehaviour
5   - extend ActiveSupport::Concern
  4 +module RSpec::Rails
  5 + module ControllerExampleGroup
  6 + extend ActiveSupport::Concern
6 7
7   - include RSpec::Rails::SetupAndTeardownAdapter
8   - include RSpec::Rails::TestUnitAssertionAdapter
9   - include ActionController::TestCase::Behavior
10   - include RSpec::Rails::ViewRendering
11   - include Webrat::Matchers
12   - include Webrat::Methods
13   - include RSpec::Matchers
  8 + include RSpec::Rails::SetupAndTeardownAdapter
  9 + include RSpec::Rails::TestUnitAssertionAdapter
  10 + include ActionController::TestCase::Behavior
  11 + include RSpec::Rails::ViewRendering
  12 + include Webrat::Matchers
  13 + include Webrat::Methods
  14 + include RSpec::Matchers
14 15
15   - attr_reader :controller
  16 + attr_reader :controller
16 17
17   - module ClassMethods
18   - def controller_class
19   - describes
  18 + module ClassMethods
  19 + def controller_class
  20 + describes
  21 + end
20 22 end
21   - end
22 23
23   - included do
24   - before do
25   - @routes = ::Rails.application.routes
26   - ActionController::Base.allow_forgery_protection = false
  24 + included do
  25 + before do
  26 + @routes = ::Rails.application.routes
  27 + ActionController::Base.allow_forgery_protection = false
  28 + end
27 29 end
28   - end
29 30
30   - RSpec.configure do |c|
31   - c.include self, :example_group => { :file_path => /\bspec\/controllers\// }
  31 + RSpec.configure do |c|
  32 + c.include self, :example_group => { :file_path => /\bspec\/controllers\// }
  33 + end
32 34 end
33 35 end
61 lib/rspec/rails/example/helper_example_group.rb
... ... @@ -1,43 +1,44 @@
1 1 require 'webrat'
2 2 require 'rspec/rails/view_assigns'
3 3
4   -module HelperExampleGroupBehaviour
5   - extend ActiveSupport::Concern
6   -
7   - include RSpec::Rails::SetupAndTeardownAdapter
8   - include RSpec::Rails::TestUnitAssertionAdapter
9   - include ActionView::TestCase::Behavior
10   - include RSpec::Rails::ViewAssigns
11   - include Webrat::Matchers
12   -
13   - module ClassMethods
14   - def determine_default_helper_class(ignore)
15   - describes
  4 +module RSpec::Rails
  5 + module HelperExampleGroup
  6 + extend ActiveSupport::Concern
  7 +
  8 + include RSpec::Rails::SetupAndTeardownAdapter
  9 + include RSpec::Rails::TestUnitAssertionAdapter
  10 + include ActionView::TestCase::Behavior
  11 + include RSpec::Rails::ViewAssigns
  12 + include Webrat::Matchers
  13 +
  14 + module ClassMethods
  15 + def determine_default_helper_class(ignore)
  16 + describes
  17 + end
16 18 end
17   - end
18 19
19   - module InstanceMethods
20   - # Returns an instance of ActionView::Base instrumented with this helper and
21   - # any of the built-in rails helpers.
22   - def helper
23   - _view
24   - end
  20 + module InstanceMethods
  21 + # Returns an instance of ActionView::Base instrumented with this helper and
  22 + # any of the built-in rails helpers.
  23 + def helper
  24 + _view
  25 + end
25 26
26   - private
  27 + private
27 28
28   - def _controller_path
29   - running_example.example_group.describes.to_s.sub(/Helper/,'').underscore
  29 + def _controller_path
  30 + running_example.example_group.describes.to_s.sub(/Helper/,'').underscore
  31 + end
30 32 end
31   - end
32 33
33   - included do
34   - before do
35   - controller.controller_path = _controller_path
  34 + included do
  35 + before do
  36 + controller.controller_path = _controller_path
  37 + end
36 38 end
37   - end
38 39
39   - RSpec.configure do |c|
40   - c.include self, :example_group => { :file_path => /\bspec\/helpers\// }
  40 + RSpec.configure do |c|
  41 + c.include self, :example_group => { :file_path => /\bspec\/helpers\// }
  42 + end
41 43 end
42 44 end
43   -
38 lib/rspec/rails/example/mailer_example_group.rb
... ... @@ -1,27 +1,29 @@
1 1 require 'webrat'
2 2
3   -module MailerExampleGroupBehaviour
4   - extend ActiveSupport::Concern
  3 +module RSpec::Rails
  4 + module MailerExampleGroup
  5 + extend ActiveSupport::Concern
5 6
6   - include Webrat::Matchers
7   - include RSpec::Matchers
  7 + include Webrat::Matchers
  8 + include RSpec::Matchers
8 9
9   - def read_fixture(action)
10   - IO.readlines(File.join(Rails.root, 'spec', 'fixtures', self.described_class.name.underscore, action))
11   - end
  10 + def read_fixture(action)
  11 + IO.readlines(File.join(Rails.root, 'spec', 'fixtures', self.described_class.name.underscore, action))
  12 + end
12 13
13   - included do
14   - before do
15   - ActionMailer::Base.delivery_method = :test
16   - ActionMailer::Base.perform_deliveries = true
17   - ActionMailer::Base.deliveries.clear
18   - @expected = Mail.new
19   - @expected.content_type ["text", "plain", { "charset" => "utf-8" }]
20   - @expected.mime_version = '1.0'
  14 + included do
  15 + before do
  16 + ActionMailer::Base.delivery_method = :test
  17 + ActionMailer::Base.perform_deliveries = true
  18 + ActionMailer::Base.deliveries.clear
  19 + @expected = Mail.new
  20 + @expected.content_type ["text", "plain", { "charset" => "utf-8" }]
  21 + @expected.mime_version = '1.0'
  22 + end
21 23 end
22   - end
23 24
24   - RSpec.configure do |c|
25   - c.include self, :example_group => { :file_path => /\bspec\/mailers\// }
  25 + RSpec.configure do |c|
  26 + c.include self, :example_group => { :file_path => /\bspec\/mailers\// }
  27 + end
26 28 end
27 29 end
50 lib/rspec/rails/example/request_example_group.rb
... ... @@ -1,35 +1,37 @@
1 1 require 'action_dispatch'
2 2 require 'webrat'
3 3
4   -module RequestExampleGroupBehaviour
5   - extend ActiveSupport::Concern
  4 +module RSpec::Rails
  5 + module RequestExampleGroup
  6 + extend ActiveSupport::Concern
6 7
7   - include ActionDispatch::Integration::Runner
8   - include RSpec::Rails::TestUnitAssertionAdapter
9   - include ActionDispatch::Assertions
10   - include Webrat::Matchers
11   - include Webrat::Methods
12   - include RSpec::Matchers
  8 + include ActionDispatch::Integration::Runner
  9 + include RSpec::Rails::TestUnitAssertionAdapter
  10 + include ActionDispatch::Assertions
  11 + include Webrat::Matchers
  12 + include Webrat::Methods
  13 + include RSpec::Matchers
13 14
14   - included do
15   - before do
16   - @router = ::Rails.application.routes
  15 + included do
  16 + before do
  17 + @router = ::Rails.application.routes
  18 + end
  19 + end
  20 +
  21 + def app
  22 + ::Rails.application
17 23 end
18   - end
19   -
20   - def app
21   - ::Rails.application
22   - end
23 24
24   - def last_response
25   - response
26   - end
  25 + def last_response
  26 + response
  27 + end
27 28
28   - Webrat.configure do |config|
29   - config.mode = :rack
30   - end
  29 + Webrat.configure do |config|
  30 + config.mode = :rack
  31 + end
31 32
32   - RSpec.configure do |c|
33   - c.include self, :example_group => { :file_path => /\bspec\/requests\// }
  33 + RSpec.configure do |c|
  34 + c.include self, :example_group => { :file_path => /\bspec\/requests\// }
  35 + end
34 36 end
35 37 end
100 lib/rspec/rails/example/view_example_group.rb
... ... @@ -1,62 +1,64 @@
1 1 require 'webrat'
2 2 require 'rspec/rails/view_assigns'
3 3
4   -module ViewExampleGroupBehaviour
5   - extend ActiveSupport::Concern
6   -
7   - include RSpec::Rails::SetupAndTeardownAdapter
8   - include RSpec::Rails::TestUnitAssertionAdapter
9   - include ActionView::TestCase::Behavior
10   - include RSpec::Rails::ViewAssigns
11   - include Webrat::Matchers
12   -
13   - module InstanceMethods
14   - def response
15   - RSpec.deprecate("response", "rendered")
16   - rendered
17   - end
  4 +module RSpec::Rails
  5 + module ViewExampleGroup
  6 + extend ActiveSupport::Concern
18 7
19   - # :callseq:
20   - # render
21   - # render(:template => "widgets/new.html.erb")
22   - # render({:partial => "widgets/widget.html.erb"}, {... locals ...})
23   - # render({:partial => "widgets/widget.html.erb"}, {... locals ...}) do ... end
24   - #
25   - # Delegates to ActionView::Base#render, so see documentation on that for more
26   - # info.
27   - #
28   - # The only addition is that you can call render with no arguments, and RSpec
29   - # will pass the top level description to render:
30   - #
31   - # describe "widgets/new.html.erb" do
32   - # it "shows all the widgets" do
33   - # render # => view.render(:file => "widgets/new.html.erb")
34   - # ...
35   - # end
36   - # end
37   - def render(options={}, local_assigns={}, &block)
38   - options = {:template => _default_file_to_render} if Hash === options and options.empty?
39   - super(options, local_assigns, &block)
40   - end
  8 + include RSpec::Rails::SetupAndTeardownAdapter
  9 + include RSpec::Rails::TestUnitAssertionAdapter
  10 + include ActionView::TestCase::Behavior
  11 + include RSpec::Rails::ViewAssigns
  12 + include Webrat::Matchers
41 13
42   - private
  14 + module InstanceMethods
  15 + def response
  16 + RSpec.deprecate("response", "rendered")
  17 + rendered
  18 + end
43 19
44   - def _default_file_to_render
45   - running_example.example_group.top_level_description
46   - end
  20 + # :callseq:
  21 + # render
  22 + # render(:template => "widgets/new.html.erb")
  23 + # render({:partial => "widgets/widget.html.erb"}, {... locals ...})
  24 + # render({:partial => "widgets/widget.html.erb"}, {... locals ...}) do ... end
  25 + #
  26 + # Delegates to ActionView::Base#render, so see documentation on that for more
  27 + # info.
  28 + #
  29 + # The only addition is that you can call render with no arguments, and RSpec
  30 + # will pass the top level description to render:
  31 + #
  32 + # describe "widgets/new.html.erb" do
  33 + # it "shows all the widgets" do
  34 + # render # => view.render(:file => "widgets/new.html.erb")
  35 + # ...
  36 + # end
  37 + # end
  38 + def render(options={}, local_assigns={}, &block)
  39 + options = {:template => _default_file_to_render} if Hash === options and options.empty?
  40 + super(options, local_assigns, &block)
  41 + end
  42 +
  43 + private
47 44
48   - def _controller_path
49   - _default_file_to_render.split("/")[0..-2].join("/")
  45 + def _default_file_to_render
  46 + running_example.example_group.top_level_description
  47 + end
  48 +
  49 + def _controller_path
  50 + _default_file_to_render.split("/")[0..-2].join("/")
  51 + end
50 52 end
51   - end
52 53
53   - included do
54   - before do
55   - controller.controller_path = _controller_path
  54 + included do
  55 + before do
  56 + controller.controller_path = _controller_path
  57 + end
56 58 end
57   - end
58 59
59   - RSpec.configure do |c|
60   - c.include self, :example_group => { :file_path => /\bspec\/views\// }
  60 + RSpec.configure do |c|
  61 + c.include self, :example_group => { :file_path => /\bspec\/views\// }
  62 + end
61 63 end
62 64 end
16 spec/rspec/rails/example/controller_example_group_spec.rb
... ... @@ -1,11 +1,13 @@
1 1 require "spec_helper"
2 2
3   -describe ControllerExampleGroupBehaviour do
4   - it "is included in specs in ./spec/controllers" do
5   - stub_metadata(
6   - :example_group => {:file_path => "./spec/controllers/whatever_spec.rb:15"}
7   - )
8   - group = RSpec::Core::ExampleGroup.describe
9   - group.included_modules.should include(ControllerExampleGroupBehaviour)
  3 +module RSpec::Rails
  4 + describe ControllerExampleGroup do
  5 + it "is included in specs in ./spec/controllers" do
  6 + stub_metadata(
  7 + :example_group => {:file_path => "./spec/controllers/whatever_spec.rb:15"}
  8 + )
  9 + group = RSpec::Core::ExampleGroup.describe
  10 + group.included_modules.should include(ControllerExampleGroup)
  11 + end
10 12 end
11 13 end
30 spec/rspec/rails/example/helper_example_group_spec.rb
... ... @@ -1,20 +1,22 @@
1 1 require "spec_helper"
2 2
3   -describe HelperExampleGroupBehaviour do
4   - it "is included in specs in ./spec/views" do
5   - stub_metadata(
6   - :example_group => {:file_path => "./spec/helpers/whatever_spec.rb:15"}
7   - )
8   - group = RSpec::Core::ExampleGroup.describe
9   - group.included_modules.should include(HelperExampleGroupBehaviour)
10   - end
  3 +module RSpec::Rails
  4 + describe HelperExampleGroup do
  5 + it "is included in specs in ./spec/views" do
  6 + stub_metadata(
  7 + :example_group => {:file_path => "./spec/helpers/whatever_spec.rb:15"}
  8 + )
  9 + group = RSpec::Core::ExampleGroup.describe
  10 + group.included_modules.should include(HelperExampleGroup)
  11 + end
11 12
12   - module ::FoosHelper; end
  13 + module ::FoosHelper; end
13 14
14   - it "provides a controller_path based on the helper module's name" do
15   - helper_spec = Object.new
16   - helper_spec.extend HelperExampleGroupBehaviour::InstanceMethods
17   - helper_spec.stub_chain(:running_example, :example_group, :describes).and_return(FoosHelper)
18   - helper_spec.__send__(:_controller_path).should == "foos"
  15 + it "provides a controller_path based on the helper module's name" do
  16 + helper_spec = Object.new
  17 + helper_spec.extend HelperExampleGroup::InstanceMethods
  18 + helper_spec.stub_chain(:running_example, :example_group, :describes).and_return(FoosHelper)
  19 + helper_spec.__send__(:_controller_path).should == "foos"
  20 + end
19 21 end
20 22 end
16 spec/rspec/rails/example/mailer_example_group_spec.rb
... ... @@ -1,11 +1,13 @@
1 1 require "spec_helper"
2 2
3   -describe MailerExampleGroupBehaviour do
4   - it "is included in specs in ./spec/mailers" do
5   - stub_metadata(
6   - :example_group => {:file_path => "./spec/mailers/whatever_spec.rb:15"}
7   - )
8   - group = RSpec::Core::ExampleGroup.describe
9   - group.included_modules.should include(MailerExampleGroupBehaviour)
  3 +module RSpec::Rails
  4 + describe MailerExampleGroup do
  5 + it "is included in specs in ./spec/mailers" do
  6 + stub_metadata(
  7 + :example_group => {:file_path => "./spec/mailers/whatever_spec.rb:15"}
  8 + )
  9 + group = RSpec::Core::ExampleGroup.describe
  10 + group.included_modules.should include(MailerExampleGroup)
  11 + end
10 12 end
11 13 end
16 spec/rspec/rails/example/request_example_group_spec.rb
... ... @@ -1,11 +1,13 @@
1 1 require "spec_helper"
2 2
3   -describe RequestExampleGroupBehaviour do
4   - it "is included in specs in ./spec/requests" do
5   - stub_metadata(
6   - :example_group => {:file_path => "./spec/requests/whatever_spec.rb:15"}
7   - )
8   - group = RSpec::Core::ExampleGroup.describe
9   - group.included_modules.should include(RequestExampleGroupBehaviour)
  3 +module RSpec::Rails
  4 + describe RequestExampleGroup do
  5 + it "is included in specs in ./spec/requests" do
  6 + stub_metadata(
  7 + :example_group => {:file_path => "./spec/requests/whatever_spec.rb:15"}
  8 + )
  9 + group = RSpec::Core::ExampleGroup.describe
  10 + group.included_modules.should include(RequestExampleGroup)
  11 + end
10 12 end
11 13 end
116 spec/rspec/rails/example/view_example_group_spec.rb
... ... @@ -1,74 +1,76 @@
1 1 require "spec_helper"
2 2
3   -describe ViewExampleGroupBehaviour do
4   - it "is included in specs in ./spec/views" do
5   - stub_metadata(
6   - :example_group => {:file_path => "./spec/views/whatever_spec.rb:15"}
7   - )
8   - group = RSpec::Core::ExampleGroup.describe
9   - group.included_modules.should include(ViewExampleGroupBehaviour)
10   - end
  3 +module RSpec::Rails
  4 + describe ViewExampleGroup do
  5 + it "is included in specs in ./spec/views" do
  6 + stub_metadata(
  7 + :example_group => {:file_path => "./spec/views/whatever_spec.rb:15"}
  8 + )
  9 + group = RSpec::Core::ExampleGroup.describe
  10 + group.included_modules.should include(ViewExampleGroup)
  11 + end
11 12
12   - describe "#render" do
13   - let(:view_spec) do
14   - Class.new do
15   - module Local
16   - def received
17   - @received ||= []
18   - end
19   - def render(options={}, local_assigns={}, &block)
20   - received << [options, local_assigns, block]
  13 + describe "#render" do
  14 + let(:view_spec) do
  15 + Class.new do
  16 + module Local
  17 + def received
  18 + @received ||= []
  19 + end
  20 + def render(options={}, local_assigns={}, &block)
  21 + received << [options, local_assigns, block]
  22 + end
21 23 end
22   - end
23   - include Local
24   - include ViewExampleGroupBehaviour::InstanceMethods
25   - end.new
26   - end
  24 + include Local
  25 + include ViewExampleGroup::InstanceMethods
  26 + end.new
  27 + end
27 28
28   - context "given no input" do
29   - it "sends render(:file => (described file)) to the view" do
30   - view_spec.stub(:_default_file_to_render) { "widgets/new.html.erb" }
31   - view_spec.render
32   - view_spec.received.first.should == [{:template => "widgets/new.html.erb"},{}, nil]
  29 + context "given no input" do
  30 + it "sends render(:file => (described file)) to the view" do
  31 + view_spec.stub(:_default_file_to_render) { "widgets/new.html.erb" }
  32 + view_spec.render
  33 + view_spec.received.first.should == [{:template => "widgets/new.html.erb"},{}, nil]
  34 + end
33 35 end
34   - end
35 36
36   - context "given a string" do
37   - it "sends string as the first arg to render" do
38   - view_spec.render('arbitrary/path')
39   - view_spec.received.first.should == ["arbitrary/path", {}, nil]
  37 + context "given a string" do
  38 + it "sends string as the first arg to render" do
  39 + view_spec.render('arbitrary/path')
  40 + view_spec.received.first.should == ["arbitrary/path", {}, nil]
  41 + end
40 42 end
41   - end
42 43
43   - context "given a hash" do
44   - it "sends the hash as the first arg to render" do
45   - view_spec.render(:foo => 'bar')
46   - view_spec.received.first.should == [{:foo => "bar"}, {}, nil]
  44 + context "given a hash" do
  45 + it "sends the hash as the first arg to render" do
  46 + view_spec.render(:foo => 'bar')
  47 + view_spec.received.first.should == [{:foo => "bar"}, {}, nil]
  48 + end
47 49 end
48 50 end
49   - end
50 51
51   - describe "#_controller_path" do
52   - let(:view_spec) do
53   - Class.new do
54   - include ViewExampleGroupBehaviour::InstanceMethods
55   - end.new
56   - end
57   - context "with a common _default_file_to_render" do
58   - it "it returns the directory" do
59   - view_spec.stub(:_default_file_to_render).
60   - and_return("things/new.html.erb")
61   - view_spec.__send__(:_controller_path).
62   - should == "things"
  52 + describe "#_controller_path" do
  53 + let(:view_spec) do
  54 + Class.new do
  55 + include ViewExampleGroup::InstanceMethods
  56 + end.new
  57 + end
  58 + context "with a common _default_file_to_render" do
  59 + it "it returns the directory" do
  60 + view_spec.stub(:_default_file_to_render).
  61 + and_return("things/new.html.erb")
  62 + view_spec.__send__(:_controller_path).
  63 + should == "things"
  64 + end
63 65 end
64   - end
65 66
66   - context "with a nested _default_file_to_render" do
67   - it "it returns the directory path" do
68   - view_spec.stub(:_default_file_to_render).
69   - and_return("admin/things/new.html.erb")
70   - view_spec.__send__(:_controller_path).
71   - should == "admin/things"
  67 + context "with a nested _default_file_to_render" do
  68 + it "it returns the directory path" do
  69 + view_spec.stub(:_default_file_to_render).
  70 + and_return("admin/things/new.html.erb")
  71 + view_spec.__send__(:_controller_path).
  72 + should == "admin/things"
  73 + end
72 74 end
73 75 end
74 76 end
99 spec/rspec/rails/example/view_rendering_spec.rb
... ... @@ -1,68 +1,69 @@
1 1 require "spec_helper"
2 2
3   -describe RSpec::Rails::ViewRendering do
4   - it "doesn't render views by default" do
5   - rendering_views = nil
6   - group = RSpec::Core::ExampleGroup.describe do
7   - include ControllerExampleGroupBehaviour
8   - rendering_views = render_views?
9   - it("does something") {}
10   - end
11   - group.run(double.as_null_object)
12   - rendering_views.should be_false
13   - end
14   -
15   - it "doesn't render views by default in a nested group" do
16   - rendering_views = nil
17   - group = RSpec::Core::ExampleGroup.describe do
18   - include ControllerExampleGroupBehaviour
19   - describe "nested" do
  3 +module RSpec::Rails
  4 + describe ViewRendering do
  5 + it "doesn't render views by default" do
  6 + rendering_views = nil
  7 + group = RSpec::Core::ExampleGroup.describe do
  8 + include ControllerExampleGroup
20 9 rendering_views = render_views?
21 10 it("does something") {}
22 11 end
  12 + group.run(double.as_null_object)
  13 + rendering_views.should be_false
23 14 end
24   - group.run(double.as_null_object)
25   - rendering_views.should be_false
26   - end
27 15
28   - it "renders views if told to" do
29   - rendering_views = false
30   - group = RSpec::Core::ExampleGroup.describe do
31   - include ControllerExampleGroupBehaviour
32   - render_views
33   - rendering_views = render_views?
34   - it("does something") {}
  16 + it "doesn't render views by default in a nested group" do
  17 + rendering_views = nil
  18 + group = RSpec::Core::ExampleGroup.describe do
  19 + include ControllerExampleGroup
  20 + describe "nested" do
  21 + rendering_views = render_views?
  22 + it("does something") {}
  23 + end
  24 + end
  25 + group.run(double.as_null_object)
  26 + rendering_views.should be_false
35 27 end
36   - group.run(double.as_null_object)
37   - rendering_views.should be_true
38   - end
39 28
40   - it "renders views if told to in a nested group" do
41   - rendering_views = nil
42   - group = RSpec::Core::ExampleGroup.describe do
43   - include ControllerExampleGroupBehaviour
44   - describe "nested" do
  29 + it "renders views if told to" do
  30 + rendering_views = false
  31 + group = RSpec::Core::ExampleGroup.describe do
  32 + include ControllerExampleGroup
45 33 render_views
46 34 rendering_views = render_views?
47 35 it("does something") {}
48 36 end
  37 + group.run(double.as_null_object)
  38 + rendering_views.should be_true
49 39 end
50   - group.run(double.as_null_object)
51   - rendering_views.should be_true
52   - end
53 40
54   - it "renders views in a nested group if told to in an outer group" do
55   - rendering_views = nil
56   - group = RSpec::Core::ExampleGroup.describe do
57   - include ControllerExampleGroupBehaviour
58   - render_views
59   - describe "nested" do
60   - rendering_views = render_views?
61   - it("does something") {}
  41 + it "renders views if told to in a nested group" do
  42 + rendering_views = nil
  43 + group = RSpec::Core::ExampleGroup.describe do
  44 + include ControllerExampleGroup
  45 + describe "nested" do
  46 + render_views
  47 + rendering_views = render_views?
  48 + it("does something") {}
  49 + end
62 50 end
  51 + group.run(double.as_null_object)
  52 + rendering_views.should be_true
  53 + end
  54 +
  55 + it "renders views in a nested group if told to in an outer group" do
  56 + rendering_views = nil
  57 + group = RSpec::Core::ExampleGroup.describe do
  58 + include ControllerExampleGroup
  59 + render_views
  60 + describe "nested" do
  61 + rendering_views = render_views?
  62 + it("does something") {}
  63 + end
  64 + end
  65 + group.run(double.as_null_object)
  66 + rendering_views.should be_true
63 67 end
64   - group.run(double.as_null_object)
65   - rendering_views.should be_true
66 68 end
67 69 end
68   -

0 comments on commit a6a35a6

Please sign in to comment.
Something went wrong with that request. Please try again.