Skip to content

Commit

Permalink
jruby needs a separate sqlite3 adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Dec 13, 2012
1 parent e43f18d commit 742f38d
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions features/fixture_replacement_config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions features/generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`
Expand Down
1 change: 1 addition & 0 deletions features/load_definitions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
12 changes: 12 additions & 0 deletions features/step_definitions/rails_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions gemfiles/rails3.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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=>"../"
13 changes: 13 additions & 0 deletions gemfiles/rails3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -98,20 +107,24 @@ 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
polyglot (>= 0.3.1)
tzinfo (0.3.35)

PLATFORMS
java
ruby

DEPENDENCIES
activerecord-jdbcsqlite3-adapter
appraisal (~> 0.5.0)
aruba (~> 0.5.1)
cucumber (~> 1.2.1)
factory_girl_rails!
rails (~> 3.0.17)
rake
rspec (~> 2.11.0)
sqlite3 (>= 1.3.4)
3 changes: 2 additions & 1 deletion gemfiles/rails3.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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=>"../"
11 changes: 11 additions & 0 deletions gemfiles/rails3.1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion gemfiles/rails3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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=>"../"
11 changes: 11 additions & 0 deletions gemfiles/rails3.2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 742f38d

Please sign in to comment.