Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 77 lines (60 sloc) 2.084 kB
b3f7765 @winton Adding ability to build a gem for every gemset (dependencies change b…
authored
1 require 'pp'
2
efebcbe @winton Getting rid of bundler
authored
3 $root = File.expand_path('../../', __FILE__)
e9cd7b6 @winton Merge branch 'rails' of github.com:winton/gem_template
authored
4 require "#{$root}/lib/acts_as_archive/gems"
c542e7f @winton Using Bundler instead of Require
authored
5
2f25892 @winton Merge branch 'rails' of github.com:winton/gem_template
authored
6 ActsAsArchive::Gems.activate :framework_fixture
b019166 @winton Specs really ready for framework testing (Rails 2 test working)
authored
7 require 'framework_fixture'
d95c6b6 @winton Sinatra specs passing, added spec/run for convenience
authored
8
9 if FrameworkFixture.framework == 'rails'
678edf2 @winton Added specs for schema, migrate_from_acts_as_paranoid, restore_all, a…
authored
10 ENV['RAILS_ENV'] = 'test'
d95c6b6 @winton Sinatra specs passing, added spec/run for convenience
authored
11 FrameworkFixture.generate File.dirname(__FILE__) + '/fixtures'
12 end
cc6c0c1 @winton First commit: partially working, partially tested
authored
13
2fc35bb @winton Specs for rails 2 and 3 passing
authored
14 ActsAsArchive::Gems.activate %w(active_wrapper-solo rack-test rspec)
15 require 'active_wrapper/gems'
e4aeb07 @winton Merge branch 'master' into spec-activerecord
authored
16
d95c6b6 @winton Sinatra specs passing, added spec/run for convenience
authored
17 # Framework specs
b019166 @winton Specs really ready for framework testing (Rails 2 test working)
authored
18 if FrameworkFixture.framework
19 require 'rack/test'
2d214bc @winton Merge fixes
authored
20
2fc35bb @winton Specs for rails 2 and 3 passing
authored
21 if FrameworkFixture.rails == '<3'
22 ActiveWrapper::Gems.gemset = :ar2
d95c6b6 @winton Sinatra specs passing, added spec/run for convenience
authored
23 elsif FrameworkFixture.sinatra
24 ActiveWrapper::Gems.activate %w(activesupport)
25 require 'active_support/dependencies'
26 ActiveSupport::Dependencies.autoload_paths << "#{$root}/spec/fixtures/builds/sinatra#{ENV['SINATRA']}/app/models"
27 ActiveSupport::Dependencies.autoload_paths << "#{$root}/spec/fixtures/builds/sinatra#{ENV['SINATRA']}/app/helpers"
2fc35bb @winton Specs for rails 2 and 3 passing
authored
28 end
29
30 require 'active_wrapper'
d95c6b6 @winton Sinatra specs passing, added spec/run for convenience
authored
31
32 # Normal specs
2fc35bb @winton Specs for rails 2 and 3 passing
authored
33 else
34 if ENV['ACTIVERECORD'] == '2'
35 ActiveWrapper::Gems.gemset = :ar2
36 else
37 ActiveWrapper::Gems.activate %w(activesupport)
38 require 'active_support/dependencies'
39 end
b019166 @winton Specs really ready for framework testing (Rails 2 test working)
authored
40
41 require 'active_wrapper'
42
43 require "#{$root}/lib/acts_as_archive"
44
45 ActiveSupport::Dependencies.autoload_paths << "#{$root}/spec/fixtures/models"
2fc35bb @winton Specs for rails 2 and 3 passing
authored
46 ActiveSupport::Dependencies.autoload_paths << "#{$root}/spec/fixtures/helpers"
2f25892 @winton Merge branch 'rails' of github.com:winton/gem_template
authored
47
2fc35bb @winton Specs for rails 2 and 3 passing
authored
48 include SpecHelper
079d585 @winton Automatically generating associations that have a dependent option fo…
authored
49 end
50
2fc35bb @winton Specs for rails 2 and 3 passing
authored
51 $db, $log, $mail = ActiveWrapper.setup(
52 :adapter => ActiveWrapper::Gems.gemset == :ar2 ? 'mysql' : 'mysql2',
53 :base => "#{$root}/spec/fixtures",
54 :env => 'test'
55 )
56 $db.establish_connection
3bb4a93 @winton Working on framework fixtures
authored
57
dd7b490 @winton Moving ActsAsArchive configuration to YAML file (config/acts_as_archi…
authored
58 unless FrameworkFixture.framework
59 ActsAsArchive.load_from_yaml("#{$root}/spec/fixtures")
60 end
61
d95c6b6 @winton Sinatra specs passing, added spec/run for convenience
authored
62 if FrameworkFixture.framework == 'sinatra'
63 FrameworkFixture.generate File.dirname(__FILE__) + '/fixtures'
64 end
65
079d585 @winton Automatically generating associations that have a dependent option fo…
authored
66 Spec::Runner.configure do |config|
2fc35bb @winton Specs for rails 2 and 3 passing
authored
67 end
68
69 def before_each(migrate=true, setup=true)
70 if migrate
71 [ 8, 0, 8 ].each { |v| $db.migrate(v) }
678edf2 @winton Added specs for schema, migrate_from_acts_as_paranoid, restore_all, a…
authored
72 Record.reset_column_information
2fc35bb @winton Specs for rails 2 and 3 passing
authored
73 end
74 if setup
75 @record, @lengths, @zero_lengths = setup_records
76 end
e9cd7b6 @winton Merge branch 'rails' of github.com:winton/gem_template
authored
77 end
Something went wrong with that request. Please try again.