Adding JRuby support to FactoryGirl

JRuby are affected by inconsistent behavior of overriding
  #respond_to? that is causing an unconditional call to
  #respond_to_missing.

  Current change does not affect MRI users in any way,
  JRuby-specific things are wrapped into the RUBY_PLATFORM
  check.

  Adding docs, modifying gemspec and travis.yml to make factory_girl to pass on Travis.

  Wire up tests
This commit is contained in:
Oleksandr Petrov 2012-07-06 11:27:40 +02:00 committed by Joshua Clayton
parent e038bf8eec
commit d48b7601c2
7 changed files with 38 additions and 1 deletions

View File

@ -1,9 +1,12 @@
rvm:
- 1.9.2
- 1.9.3
- jruby-19mode
before_install:
- gem update --system
script: "bundle exec rake spec:unit spec:acceptance features"
jdk:
- openjdk6
gemfile:
- gemfiles/3.0.gemfile
- gemfiles/3.1.gemfile

View File

@ -16,6 +16,13 @@ If you're *not* using Rails, you'll just have to change the required version of
gem "factory_girl", "~> 3.0"
```
JRuby users: FactoryGirl works with JRuby starting with 1.6.7.2 (latest stable, as per July 2012).
JRuby has to be used in 1.9 mode, for that, use JRUBY_OPTS environment variable:
```
export JRUBY_OPTS=--1.9
```
Once your Gemfile is updated, you'll want to update your bundle.
Using Without Bundler

View File

@ -40,10 +40,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
gherkin (2.9.3-java)
json (>= 1.4.6)
i18n (0.6.0)
json (1.7.0)
json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@ -70,6 +74,7 @@ GEM
yard (0.8.1)
PLATFORMS
java
ruby
DEPENDENCIES

View File

@ -31,7 +31,14 @@ Gem::Specification.new do |s|
s.add_development_dependency("mocha")
s.add_development_dependency("bourne")
s.add_development_dependency("appraisal", "~> 0.4")
s.add_development_dependency("sqlite3-ruby")
if RUBY_PLATFORM == "java"
s.add_development_dependency("activerecord-jdbcsqlite3-adapter")
s.add_development_dependency("jdbc-sqlite3")
else
s.add_development_dependency("sqlite3-ruby")
end
s.add_development_dependency("yard")
end

View File

@ -39,10 +39,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
gherkin (2.9.3-java)
json (>= 1.4.6)
i18n (0.5.0)
json (1.7.0)
json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@ -69,6 +73,7 @@ GEM
yard (0.8.1)
PLATFORMS
java
ruby
DEPENDENCIES

View File

@ -40,10 +40,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
gherkin (2.9.3-java)
json (>= 1.4.6)
i18n (0.6.0)
json (1.7.0)
json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@ -70,6 +74,7 @@ GEM
yard (0.8.1)
PLATFORMS
java
ruby
DEPENDENCIES

View File

@ -40,10 +40,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
gherkin (2.9.3-java)
json (>= 1.4.6)
i18n (0.6.0)
json (1.7.0)
json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@ -70,6 +74,7 @@ GEM
yard (0.8.1)
PLATFORMS
java
ruby
DEPENDENCIES