Skip to content

Commit

Permalink
Development env now works correctly with bundler.
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 22, 2010
1 parent 46cae15 commit f8b5560
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
source "http://rubygems.org"

gem 'arel', :path => "./vendor/arel"
gem 'arel', :path => "./vendor/arel"
gem 'rails', :path => "./vendor/rails"
gem 'rspec', '>= 2.0.0.beta.10'
gem 'rspec-core', :path => "../rspec-core"
gem 'rspec-expectations', :path => "../rspec-expectations"
gem 'rspec-mocks', :path => "../rspec-mocks"
gem 'rspec', :path => "../rspec"
gem 'thor'
gem 'cucumber'
gem 'aruba'
gem 'jeweler'
Expand Down
7 changes: 5 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require "bundler"
Bundler.setup

require 'rake'
require 'yaml'

Expand Down Expand Up @@ -92,8 +95,8 @@ namespace :generate do
desc "generate a fresh app with rspec installed"
task :app => ["rails:clone"] do |t|
unless File.directory?('./tmp/example_app')
ruby "./vendor/rails/bin/rails new ./tmp/example_app"
system "cp ./templates/Gemfile ./tmp/example_app/"
sh "bundle exec ./vendor/rails/bin/rails new ./tmp/example_app"
sh "cp ./templates/Gemfile ./tmp/example_app/"
end
end

Expand Down
21 changes: 19 additions & 2 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
require "aruba"
require "rspec/expectations"
require 'bundler'
Bundler.setup

require 'aruba'
require 'rspec/expectations'

module ArubaOverrides
def detect_ruby_script(cmd)
if cmd =~ /^rspec /
"bundle exec ../../../rspec-core/bin/#{cmd}"
elsif cmd =~ /^ruby /
"bundle exec #{cmd}"
else
super(cmd)
end
end
end

World(ArubaOverrides)

unless File.directory?('./tmp/example_app')
system "rake generate:app generate:stuff"
Expand Down
8 changes: 5 additions & 3 deletions templates/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ gem "rails", :path => "../../vendor/rails"

gem 'sqlite3-ruby', :require => 'sqlite3'

group :test do
gem "rspec-rails", :path => "../../../rspec-rails"
end
gem "rspec", :path => "../../../rspec"
gem "rspec-core", :path => "../../../rspec-core"
gem "rspec-expectations", :path => "../../../rspec-expectations"
gem "rspec-mocks", :path => "../../../rspec-mocks"
gem "rspec-rails", :path => "../../../rspec-rails"
2 changes: 1 addition & 1 deletion templates/run_specs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run('rspec spec -cfdoc')
run('bundle exec ../../../rspec-core/bin/rspec spec -cfdoc')
run('rake spec')
run('rake spec:requests')
run('rake spec:models')
Expand Down

0 comments on commit f8b5560

Please sign in to comment.