From 6785f596b468dfcfe15155f3d439abd04cb676dc Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sun, 18 Sep 2011 21:39:18 +0700 Subject: [PATCH] Update Gem configuration for Ruby 1.9.3 and JRuby --- Appraisals | 5 ++--- Gemfile | 9 ++++++++- features/rails_integration.feature | 3 ++- features/step_definitions/rails_steps.rb | 12 ++++++++++-- gemfiles/3.0.gemfile | 8 +++++++- gemfiles/3.1.gemfile | 12 +++++++++--- shoulda-matchers.gemspec | 7 ------- 7 files changed, 38 insertions(+), 18 deletions(-) diff --git a/Appraisals b/Appraisals index a5b5b717..2d5e63df 100644 --- a/Appraisals +++ b/Appraisals @@ -1,12 +1,11 @@ appraise "3.0" do gem "rails", "3.0.10" - gem "rake", "~> 0.8.7" end appraise "3.1" do gem "rails", "3.1.0" - gem 'sass' - gem 'coffee-script' gem 'uglifier' gem 'jquery-rails' + gem 'coffee-rails' + gem 'sass-rails' end diff --git a/Gemfile b/Gemfile index 1a593521..25545821 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,12 @@ source 'http://rubygems.org' gemspec -gem 'rake', '~> 0.8.7' +gem 'rake', '~> 0.9.2' +# For test Rails application +gem 'sqlite3', :platform => :ruby +gem 'activerecord-jdbc-adapter', :platform => :jruby +gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby +gem 'jdbc-sqlite3', :platform => :jruby +gem 'jruby-openssl', :platform => :jruby +gem 'shoulda-context', '~> 1.0.0.beta1' diff --git a/features/rails_integration.feature b/features/rails_integration.feature index db21cc0c..691d4088 100644 --- a/features/rails_integration.feature +++ b/features/rails_integration.feature @@ -54,7 +54,8 @@ Feature: integrate with Rails should assign_to(:example) end """ - When I successfully run `bundle exec rake test TESTOPTS=-v --trace` + When I set the "TESTOPTS" environment variable to "-v" + When I successfully run `bundle exec rake test --trace` Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors" And the output should contain "2 tests, 2 assertions, 0 failures, 0 errors" And the output should contain "User should require name to be set" diff --git a/features/step_definitions/rails_steps.rb b/features/step_definitions/rails_steps.rb index ce9ff4af..494c962e 100644 --- a/features/step_definitions/rails_steps.rb +++ b/features/step_definitions/rails_steps.rb @@ -19,10 +19,14 @@ When /^I generate a new rails application$/ do When I run `rails new #{APP_NAME}` And I cd to "#{APP_NAME}" And I comment out the gem "turn" from the Gemfile - And I append gems from Appraisal Gemfile And I reset Bundler environment variable + And I set the "BUNDLE_GEMFILE" environment variable to "Gemfile" And I successfully run `bundle install --local` } + if RUBY_VERSION >= "1.9.3" + append_to_gemfile %(gem "rake", "~> 0.9.3.beta.1") + Then %(I successfully run `bundle update rake`) + end end When /^I configure the application to use "([^\"]+)" from this project$/ do |name| @@ -42,10 +46,14 @@ When /^I configure the application to use rspec\-rails$/ do end When /^I configure the application to use shoulda-context$/ do - append_to_gemfile "gem 'shoulda-context', :git => 'git@github.com:thoughtbot/shoulda-context.git'" + append_to_gemfile "gem 'shoulda-context', '~> 1.0.0.beta1'" steps %{And I run `bundle install --local`} end +When /^I set the "([^"]*)" environment variable to "([^"]*)"$/ do |key, value| + ENV[key] = value +end + When /^I configure a wildcard route$/ do steps %{ When I write to "config/routes.rb" with: diff --git a/gemfiles/3.0.gemfile b/gemfiles/3.0.gemfile index 253140c2..d9962053 100644 --- a/gemfiles/3.0.gemfile +++ b/gemfiles/3.0.gemfile @@ -2,7 +2,13 @@ source "http://rubygems.org" -gem "rake", "~> 0.8.7" +gem "rake", "~> 0.9.2" +gem "sqlite3", :platform=>:ruby +gem "activerecord-jdbc-adapter", :platform=>:jruby +gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby +gem "jdbc-sqlite3", :platform=>:jruby +gem "jruby-openssl", :platform=>:jruby +gem "shoulda-context", "~> 1.0.0.beta1" gem "rails", "3.0.10" gemspec :path=>"../" \ No newline at end of file diff --git a/gemfiles/3.1.gemfile b/gemfiles/3.1.gemfile index 66fa2c91..4538bada 100644 --- a/gemfiles/3.1.gemfile +++ b/gemfiles/3.1.gemfile @@ -2,11 +2,17 @@ source "http://rubygems.org" -gem "rake", "~> 0.8.7" +gem "rake", "~> 0.9.2" +gem "sqlite3", :platform=>:ruby +gem "activerecord-jdbc-adapter", :platform=>:jruby +gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby +gem "jdbc-sqlite3", :platform=>:jruby +gem "jruby-openssl", :platform=>:jruby +gem "shoulda-context", "~> 1.0.0.beta1" gem "rails", "3.1.0" -gem "sass" -gem "coffee-script" gem "uglifier" gem "jquery-rails" +gem "coffee-rails" +gem "sass-rails" gemspec :path=>"../" \ No newline at end of file diff --git a/shoulda-matchers.gemspec b/shoulda-matchers.gemspec index 79c87a81..c042d3b7 100644 --- a/shoulda-matchers.gemspec +++ b/shoulda-matchers.gemspec @@ -19,19 +19,12 @@ Gem::Specification.new do |s| s.summary = %q{Making tests easy on the fingers and eyes} s.description = %q{Making tests easy on the fingers and eyes} - s.add_development_dependency("sqlite3-ruby", "~> 1.3.2") s.add_development_dependency("mocha", "~> 0.9.10") s.add_development_dependency("rspec-rails", "~> 2.6.1.beta1") s.add_development_dependency("cucumber", "~> 0.10.0") s.add_development_dependency("appraisal", "~> 0.3.4") s.add_development_dependency("aruba") - if RUBY_VERSION >= "1.9" - s.add_development_dependency("ruby-debug19", "~> 0.11.6") - else - s.add_development_dependency("ruby-debug", "~> 0.10.4") - end - if s.respond_to? :specification_version then s.specification_version = 3 else