1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/lib/shoulda.rb
Tammer Saleh b415bff884 Revert bunch of bad commits:
2442d1f608
35213b5a1b
804f859435
fc938bb185

Getting the following error when running tests in a real project:

  ...activesupport/lib/active_support/dependencies.rb:276:in `load_missing_constant': uninitialized constant Shoulda::ActiveRecord::Base (NameError)

Think this is because of the namespace changes, but not sure.  Will investigate later.
2008-06-23 12:36:31 -04:00

43 lines
1.1 KiB
Ruby

require 'shoulda/gem/shoulda'
require 'shoulda/private_helpers'
require 'shoulda/general'
require 'shoulda/active_record_helpers'
require 'shoulda/controller_tests/controller_tests.rb'
require 'yaml'
shoulda_options = {}
possible_config_paths = []
possible_config_paths << File.join(ENV["HOME"], ".shoulda.conf") if ENV["HOME"]
possible_config_paths << "shoulda.conf"
possible_config_paths << File.join("test", "shoulda.conf")
possible_config_paths << File.join(RAILS_ROOT, "test", "shoulda.conf") if defined?(RAILS_ROOT)
possible_config_paths.each do |config_file|
if File.exists? config_file
shoulda_options = YAML.load_file(config_file).symbolize_keys
break
end
end
require 'shoulda/color' if shoulda_options[:color]
module Test # :nodoc: all
module Unit
class TestCase
include ThoughtBot::Shoulda::General
include ThoughtBot::Shoulda::Controller
extend ThoughtBot::Shoulda::ActiveRecord
end
end
end
module ActionController #:nodoc: all
module Integration
class Session
include ThoughtBot::Shoulda::General
end
end
end