spec/spec_helper.rb in transient-1.1.0 vs spec/spec_helper.rb in transient-2.0.0
- old
+ new
@@ -1,15 +1,14 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'active_record'
+require 'bundler/setup'
require 'transient'
-require 'spec'
-require 'spec/autorun'
-Spec::Runner.configure do |config|
-
+RSpec.configure do |config|
+
+ config.mock_with :rspec
+
end
ActiveRecord::Base.configurations = YAML::load( IO.read( File.dirname(__FILE__) + '/database.yml' ) )
ActiveRecord::Base.establish_connection( 'test' )
@@ -24,11 +23,11 @@
t.string :number, :limit => 35
t.string :location, :limit => 20
t.datetime :effective_at
t.datetime :expiring_at
end
-
+
create_table :addresses, :force => true do |t|
t.string :street, :limit => 75
t.string :location, :limit => 20
t.datetime :effective_at
t.datetime :expiring_at
@@ -43,6 +42,6 @@
acts_as_transient :single_active => %w(location)
end
class Address < ActiveRecord::Base
acts_as_transient :single_active => %w(location), :check_exists => %w(street location)
-end
\ No newline at end of file
+end