1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot_rails.git synced 2022-11-09 11:49:18 -05:00

jruby needs a separate sqlite3 adapter

This commit is contained in:
Matt Jankowski 2012-12-13 16:41:16 -05:00
parent e43f18ddcf
commit 742f38dc9e
11 changed files with 63 additions and 4 deletions

View file

@ -1,13 +1,17 @@
appraise "rails3.0" do
gem "rails", "~> 3.0.17"
gem "sqlite3", ">= 1.3.4", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
end
appraise "rails3.1" do
gem "rails", "~> 3.1.8"
gem "sqlite3", ">= 1.3.4"
gem "sqlite3", ">= 1.3.4", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
end
appraise "rails3.2" do
gem "rails", "~> 3.2.9"
gem "sqlite3", ">= 1.3.4"
gem "sqlite3", ">= 1.3.4", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
end

View file

@ -10,6 +10,7 @@ Feature:
Given I successfully run `bundle exec rails new testapp`
And I cd to "testapp"
And I add "factory_girl_rails" from this project as a dependency
And I configure the database connection for the application
Scenario: Using Factory Girl and Factory Girl Rails with Test Unit generates
a factory file and does not generate a fixture file

View file

@ -8,6 +8,7 @@ Feature:
When I successfully run `bundle exec rails new testapp`
And I cd to "testapp"
And I add "factory_girl_rails" from this project as a dependency
And I configure the database connection for the application
When I successfully run `bundle install`
And I successfully run `bundle exec rails generate model User name:string --fixture-replacement=factory_girl`
And I successfully run `bundle exec rails generate model Namespaced::User name:string --fixture-replacement=factory_girl`
@ -21,6 +22,7 @@ Feature:
When I successfully run `bundle exec rails new testapp`
And I cd to "testapp"
And I add "factory_girl_rails" from this project as a dependency
And I configure the database connection for the application
When I successfully run `bundle install`
And I set the FactoryGirl :suffix option to "factory"
And I successfully run `bundle exec rails generate model User name:string --fixture-replacement=factory_girl`

View file

@ -3,6 +3,7 @@ Feature: automatically load step definitions
When I successfully run `bundle exec rails new testapp`
And I cd to "testapp"
And I add "factory_girl_rails" from this project as a dependency
And I configure the database connection for the application
When I successfully run `bundle install`
And I write to "db/migrate/1_create_users.rb" with:
"""

View file

@ -41,3 +41,15 @@ class Testapp::Application
end
END
end
When /^I configure the database connection for the application$/ do
if RUBY_PLATFORM =~ /java/
overwrite_file "config/database.yml", <<-END
development: &development
adapter: jdbcsqlite3
database: db/test.sqlite3
test:
<<: *development
END
end
end

View file

@ -3,5 +3,7 @@
source "http://rubygems.org"
gem "rails", "~> 3.0.17"
gem "sqlite3", ">= 1.3.4", :platforms=>:mri
gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
gemspec :path=>"../"

View file

@ -31,6 +31,10 @@ GEM
activesupport (= 3.0.17)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activerecord-jdbc-adapter (1.2.2.1)
activerecord-jdbcsqlite3-adapter (1.2.2.1)
activerecord-jdbc-adapter (~> 1.2.2.1)
jdbc-sqlite3 (~> 3.7.2)
activeresource (3.0.17)
activemodel (= 3.0.17)
activesupport (= 3.0.17)
@ -57,10 +61,15 @@ GEM
factory_girl (4.1.0)
activesupport (>= 3.0.0)
ffi (1.2.0)
ffi (1.2.0-java)
gherkin (2.11.5)
json (>= 1.4.6)
gherkin (2.11.5-java)
json (>= 1.4.6)
i18n (0.5.0)
jdbc-sqlite3 (3.7.2)
json (1.7.5)
json (1.7.5-java)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
@ -98,6 +107,7 @@ GEM
rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3)
rspec-mocks (2.11.3)
sqlite3 (1.3.6)
thor (0.14.6)
treetop (1.4.12)
polyglot
@ -105,9 +115,11 @@ GEM
tzinfo (0.3.35)
PLATFORMS
java
ruby
DEPENDENCIES
activerecord-jdbcsqlite3-adapter
appraisal (~> 0.5.0)
aruba (~> 0.5.1)
cucumber (~> 1.2.1)
@ -115,3 +127,4 @@ DEPENDENCIES
rails (~> 3.0.17)
rake
rspec (~> 2.11.0)
sqlite3 (>= 1.3.4)

View file

@ -3,6 +3,7 @@
source "http://rubygems.org"
gem "rails", "~> 3.1.8"
gem "sqlite3", ">= 1.3.4"
gem "sqlite3", ">= 1.3.4", :platforms=>:mri
gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
gemspec :path=>"../"

View file

@ -31,6 +31,10 @@ GEM
activesupport (= 3.1.8)
arel (~> 2.2.3)
tzinfo (~> 0.3.29)
activerecord-jdbc-adapter (1.2.2.1)
activerecord-jdbcsqlite3-adapter (1.2.2.1)
activerecord-jdbc-adapter (~> 1.2.2.1)
jdbc-sqlite3 (~> 3.7.2)
activeresource (3.1.8)
activemodel (= 3.1.8)
activesupport (= 3.1.8)
@ -57,11 +61,16 @@ GEM
factory_girl (4.1.0)
activesupport (>= 3.0.0)
ffi (1.2.0)
ffi (1.2.0-java)
gherkin (2.11.5)
json (>= 1.4.6)
gherkin (2.11.5-java)
json (>= 1.4.6)
hike (1.2.1)
i18n (0.6.1)
jdbc-sqlite3 (3.7.2)
json (1.7.5)
json (1.7.5-java)
mail (2.3.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@ -117,9 +126,11 @@ GEM
tzinfo (0.3.35)
PLATFORMS
java
ruby
DEPENDENCIES
activerecord-jdbcsqlite3-adapter
appraisal (~> 0.5.0)
aruba (~> 0.5.1)
cucumber (~> 1.2.1)

View file

@ -3,6 +3,7 @@
source "http://rubygems.org"
gem "rails", "~> 3.2.9"
gem "sqlite3", ">= 1.3.4"
gem "sqlite3", ">= 1.3.4", :platforms=>:mri
gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
gemspec :path=>"../"

View file

@ -29,6 +29,10 @@ GEM
activesupport (= 3.2.9)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activerecord-jdbc-adapter (1.2.2.1)
activerecord-jdbcsqlite3-adapter (1.2.2.1)
activerecord-jdbc-adapter (~> 1.2.2.1)
jdbc-sqlite3 (~> 3.7.2)
activeresource (3.2.9)
activemodel (= 3.2.9)
activesupport (= 3.2.9)
@ -56,12 +60,17 @@ GEM
factory_girl (4.1.0)
activesupport (>= 3.0.0)
ffi (1.2.0)
ffi (1.2.0-java)
gherkin (2.11.5)
json (>= 1.4.6)
gherkin (2.11.5-java)
json (>= 1.4.6)
hike (1.2.1)
i18n (0.6.1)
jdbc-sqlite3 (3.7.2)
journey (1.0.4)
json (1.7.5)
json (1.7.5-java)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@ -116,9 +125,11 @@ GEM
tzinfo (0.3.35)
PLATFORMS
java
ruby
DEPENDENCIES
activerecord-jdbcsqlite3-adapter
appraisal (~> 0.5.0)
aruba (~> 0.5.1)
cucumber (~> 1.2.1)