Permalink
Browse files

Copy the Gemfile.lock file instead of symlinking it

- speeds rspec-rails' own cukes from 2m36s to 30s
  • Loading branch information...
dchelimsky committed Jun 5, 2010
1 parent 70f56c2 commit 21a0c1e9af314dfb4429d6d8fb6dfc8faebd4fc0
Showing with 11 additions and 1 deletion.
  1. +11 −1 features/support/env.rb
View
@@ -19,17 +19,27 @@ def write_symlink(file_or_dir)
system "ln -s #{source} #{target}"
end
def copy(file_or_dir)
source = example_app_path(file_or_dir)
target = aruba_path(file_or_dir)
system "cp -r #{source} #{target}"
end
Before do
steps %Q{
Given a directory named "spec"
}
Dir['tmp/example_app/*'].each do |file_or_dir|
unless file_or_dir =~ /spec$/
if file_or_dir =~ /Gemfile/
copy(file_or_dir)
elsif !(file_or_dir =~ /spec$/)
write_symlink(file_or_dir)
end
end
copy('tmp/example_app/.bundle')
["spec/spec_helper.rb"].each do |file_or_dir|
write_symlink("tmp/example_app/#{file_or_dir}")
end

0 comments on commit 21a0c1e

Please sign in to comment.