Skip to content

Commit

Permalink
align config extensions with changes to rspec-core planned for 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 29, 2011
1 parent 364fbb0 commit 48d4cd3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/rspec/rails/fixture_support.rb
Expand Up @@ -29,8 +29,7 @@ module FixtureSupport

RSpec.configure do |c|
c.include RSpec::Rails::FixtureSupport
c.add_setting :use_transactional_fixtures
c.add_setting :use_transactional_examples, :alias => :use_transactional_fixtures
c.add_setting :use_transactional_fixtures, :alias_with => :use_transactional_examples
c.add_setting :use_instantiated_fixtures
c.add_setting :global_fixtures
c.add_setting :fixture_path
Expand Down
18 changes: 13 additions & 5 deletions lib/rspec/rails/view_rendering.rb
@@ -1,16 +1,24 @@
require 'action_view/testing/resolvers'

RSpec.configure do |config|
config.add_setting :render_views, :default => false
# This allows us to expose `render_views` as a config option even though it
# breaks the convention of other options by using `render_views` as a
# command (i.e. render_views = true), where it would normally be used as a
# getter. This makes it easier for rspec-rails users because we use
# `render_views` directly in example groups, so this aligns the two APIs,
# but requires this workaround:
config.add_setting :rendering_views, :default => false

def config.render_views=(val)
self.rendering_views = val
end

# TODO - rspec-core needs a way to define a setting that works like this in
# one go
def config.render_views
settings[:render_views] = true
self.rendering_views = true
end

def config.render_views?
settings[:render_views]
rendering_views
end
end

Expand Down

0 comments on commit 48d4cd3

Please sign in to comment.