Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move dust to vendor from test/vendor to simplifying globbing for test…
…s, add an rspec sanity test
- Loading branch information
1 parent
c250fdd
commit 26abef6
Showing
23 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require "rubygems" | ||
gem "rspec", "1.1.11" | ||
require "test/unit" | ||
require "spec" | ||
|
||
$:.unshift(File.dirname(__FILE__) + '/../lib') | ||
|
||
RAILS_ROOT = File.dirname(__FILE__) | ||
|
||
if rails_version = ENV['RAILS_VERSION'] | ||
gem "rails", rails_version | ||
end | ||
require "rails/version" | ||
puts "==== Testing with Rails #{Rails::VERSION::STRING} ====" | ||
require 'active_record' | ||
require 'active_record/fixtures' | ||
require "action_controller" | ||
require "action_controller/test_process" | ||
|
||
require "unit_record" | ||
|
||
# Needed because of this line in setup_with_fixtures and teardown_with_fixtures: | ||
# return unless defined?(ActiveRecord::Base) && !ActiveRecord::Base.configurations.blank? | ||
ActiveRecord::Base.configurations = {"irrelevant" => {:adapter => "stub"}} | ||
|
||
ActiveRecord::Base.disconnect! :strategy => :raise, :stub_associations => true | ||
|
||
describe UnitRecord do | ||
it "disconnects tests from the database" do | ||
lambda do | ||
ActiveRecord::Base.connection.select_value("SELECT 1") | ||
end.should raise_error | ||
end | ||
|
||
it "can change strategy to noop" do | ||
ActiveRecord::Base.connection.change_strategy(:noop) do | ||
ActiveRecord::Base.connection.select_value("SELECT 1").should == nil | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.