Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't define AR extensions unless AR is defined

  • Loading branch information...
commit 83f2a44bfd31e7133248bba67bfe3ad89dc59b27 1 parent d4fa068
@dchelimsky dchelimsky authored
View
8 lib/rspec/rails/extensions/active_record/base.rb
@@ -36,11 +36,9 @@ def errors_on(attribute)
end
end
- module ActiveRecord #:nodoc:
- class Base
- extend RSpec::Rails::Extensions::ActiveRecord::ClassMethods
- include RSpec::Rails::Extensions::ActiveRecord::InstanceMethods
- end
+ class ActiveRecord::Base #:nodoc:
+ extend RSpec::Rails::Extensions::ActiveRecord::ClassMethods
+ include RSpec::Rails::Extensions::ActiveRecord::InstanceMethods
end
end
View
46 lib/rspec/rails/fixture_support.rb
@@ -1,31 +1,33 @@
-module RSpec
- module Rails
- module FixtureSupport
- extend ActiveSupport::Concern
+if defined?(ActiveRecord)
+ module RSpec
+ module Rails
+ module FixtureSupport
+ extend ActiveSupport::Concern
- include RSpec::Rails::SetupAndTeardownAdapter
- include RSpec::Rails::TestUnitAssertionAdapter
+ include RSpec::Rails::SetupAndTeardownAdapter
+ include RSpec::Rails::TestUnitAssertionAdapter
- included do
- if RSpec.configuration.use_transactional_fixtures
- # TODO - figure out how to move this outside the included block
- include ActiveRecord::TestFixtures
+ included do
+ if RSpec.configuration.use_transactional_fixtures
+ # TODO - figure out how to move this outside the included block
+ include ActiveRecord::TestFixtures
- self.fixture_path = RSpec.configuration.fixture_path
- self.use_transactional_fixtures = RSpec.configuration.use_transactional_fixtures
- self.use_instantiated_fixtures = RSpec.configuration.use_instantiated_fixtures
- fixtures RSpec.configuration.global_fixtures if RSpec.configuration.global_fixtures
+ self.fixture_path = RSpec.configuration.fixture_path
+ self.use_transactional_fixtures = RSpec.configuration.use_transactional_fixtures
+ self.use_instantiated_fixtures = RSpec.configuration.use_instantiated_fixtures
+ fixtures RSpec.configuration.global_fixtures if RSpec.configuration.global_fixtures
+ end
end
end
end
end
-end
-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_instantiated_fixtures
- c.add_setting :global_fixtures
- c.add_setting :fixture_path
+ 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_instantiated_fixtures
+ c.add_setting :global_fixtures
+ c.add_setting :fixture_path
+ end
end
View
3  rspec-rails.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["David Chelimsky", "Chad Humphries"]
- s.date = %q{2010-07-21}
+ s.date = %q{2010-07-23}
s.description = %q{RSpec-2 for Rails-3}
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
s.extra_rdoc_files = [
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
"autotest/discover.rb",
"cucumber.yml",
"features/README.markdown",
+ "features/controller_specs/anonymous_controller.feature",
"features/controller_specs/isolation_from_views.feature",
"features/controller_specs/readers.feature",
"features/controller_specs/render_views.feature",
Please sign in to comment.
Something went wrong with that request. Please try again.