Module: Rspec::Rails23::Configuration
- Defined in:
- lib/rspec/rails23/configuration.rb
Instance Method Summary collapse
-
#enable_active_record_transactional_support(filter_options = {}) ⇒ Object
:behaviour => { :describes => lambda { |dt| dt < ActiveRecord::Base }.
-
#enable_controller_support(filter_options = {}) ⇒ Object
:behaviour => { :describes => lambda { |dt| dt < ActionController::Base }.
-
#enable_helper_support(filter_options = {}) ⇒ Object
:behaviour => { :describes => lambda { |dt| dt.to_s.ends_with?(‘Helper’) }.
- #enable_rails_specific_mocking_extensions(filter_options = {}) ⇒ Object
- #enable_reasonable_defaults! ⇒ Object
- #rails ⇒ Object
Instance Method Details
#enable_active_record_transactional_support(filter_options = {}) ⇒ Object
:behaviour => { :describes => lambda { |dt| dt < ActiveRecord::Base }
11 12 13 |
# File 'lib/rspec/rails23/configuration.rb', line 11 def enable_active_record_transactional_support(={}) RSpec.configuration.extend(::Rspec::Rails23::TransactionalDatabaseSupport, ) end |
#enable_controller_support(filter_options = {}) ⇒ Object
:behaviour => { :describes => lambda { |dt| dt < ActionController::Base }
21 22 23 |
# File 'lib/rspec/rails23/configuration.rb', line 21 def enable_controller_support(={}) RSpec.configuration.extend(::Rspec::Rails23::Controllers, ) end |
#enable_helper_support(filter_options = {}) ⇒ Object
:behaviour => { :describes => lambda { |dt| dt.to_s.ends_with?(‘Helper’) }
16 17 18 |
# File 'lib/rspec/rails23/configuration.rb', line 16 def enable_helper_support(={}) RSpec.configuration.extend(::Rspec::Rails23::Helpers, ) end |
#enable_rails_specific_mocking_extensions(filter_options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rspec/rails23/configuration.rb', line 25 def enable_rails_specific_mocking_extensions(={}) case RSpec.configuration.mock_framework.to_s when /mocha/i require 'rspec/rails23/mocking/with_mocha' RSpec.configuration.include(::Rspec::Rails23::Mocking::WithMocha, ) when /rr/i require 'rspec/rails23/mocking/with_rr' RSpec.configuration.include(::Rspec::Rails23::Mocking::WithRR, ) end end |
#enable_reasonable_defaults! ⇒ Object
36 37 38 39 40 41 |
# File 'lib/rspec/rails23/configuration.rb', line 36 def enable_reasonable_defaults! enable_active_record_transactional_support enable_helper_support :behaviour => { :describes => lambda { |dt| dt.to_s.ends_with?('Helper') } } enable_controller_support :behaviour => { :describes => lambda { |dt| dt < ::ActionController::Base } } enable_rails_specific_mocking_extensions end |
#rails ⇒ Object
6 7 8 |
# File 'lib/rspec/rails23/configuration.rb', line 6 def rails self end |