Browse files

Update script/test_all so that it runs specs w/o loading bundler.

As per rspec/rspec-mocks#174, we want all specs to pass when run in isolation w/o bundler being loaded, so this helps us ensure that remains true.

Also, running w/o bundler in this fashion is about 3x faster than using bundle exec.
  • Loading branch information...
1 parent d35b6b5 commit c2dcdd4512ac79a64e762350d93e7732a84864cb @myronmarston myronmarston committed Aug 24, 2012
Showing with 23 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 .travis.yml
  3. +7 −0 script/find_path_to_rspec_exe
  4. +14 −3 script/test_all
View
1 .gitignore
@@ -17,3 +17,4 @@ bin
vendor
Gemfile-custom
.idea
+bundle
View
2 .travis.yml
@@ -1,6 +1,6 @@
before_install:
- if [[ `gem -v` != 1.8.* ]]; then gem update --system; fi
-script: "bin/rake --trace 2>&1"
+script: "script/test_all && bin/rake --trace 2>&1"
bundler_args: "--binstubs"
rvm:
- 1.8.7
View
7 script/find_path_to_rspec_exe
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+
+require File.expand_path('../../bundle/bundler/setup', __FILE__)
+rspec_core_path = $LOAD_PATH.grep(/rspec-core\/lib$/).first
+
+puts File.expand_path('../exe/rspec', rspec_core_path)
+
View
17 script/test_all
@@ -1,17 +1,28 @@
#!/bin/bash
+function print_and_run {
+ echo $1
+ ($1)
+}
+
set -e
+echo "Bundling Standalone so we can run the specs w/o bundler loaded"
+
+bundle install --standalone
+path_to_rspec_exe=`script/find_path_to_rspec_exe`
+
+command_prefix="ruby -r./bundle/bundler/setup.rb -S $path_to_rspec_exe"
+
echo "Running all..."
-bundle exec rspec spec --format progress --profile
+print_and_run "$command_prefix spec --format progress --profile"
echo
echo "--------------------------------------------------------------------"
echo
for file in `find spec -iname '*_spec.rb'`; do
- echo "Running just $file"
- bundle exec rspec $file --format progress
+ print_and_run "$command_prefix $file --format progress"
done

0 comments on commit c2dcdd4

Please sign in to comment.