Permalink
Browse files

Fix and re-enable the test_all build.

I had previously attempted to add this in b0d5007 but find_path_to_rspec_exe wasn't quite right.

Travis installs rspec-core as a :git gem so the path is `.../rspec-core-<sha>/lib`, not `.../rspec-core/lib`.
  • Loading branch information...
1 parent 3c0e7ea commit 46d5347c338e400369359899a2ed0cf3e806bada @myronmarston myronmarston committed Sep 10, 2012
Showing with 39 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +1 −1 .travis.yml
  3. +9 −0 script/find_path_to_rspec_exe
  4. +28 −0 script/test_all
View
1 .gitignore
@@ -13,3 +13,4 @@ Gemfile.lock
bin
.rbx
Gemfile-custom
+bundle
View
2 .travis.yml
@@ -1,4 +1,4 @@
-script: "bin/rake --trace 2>&1"
+script: "script/test_all && bin/rake cucumber --trace 2>&1"
bundler_args: "--binstubs"
rvm:
- 1.8.7
View
9 script/find_path_to_rspec_exe
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+
+require File.expand_path('../../bundle/bundler/setup', __FILE__)
+# git-sourced gems installed by bundler will be at a path like
+# "{gem_name}-{git_sha}"...
+rspec_core_path = $LOAD_PATH.grep(/rspec-core[^\/]*\/lib$/).first
+
+puts File.expand_path('../exe/rspec', rspec_core_path)
+
View
28 script/test_all
@@ -0,0 +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 -w -r./bundle/bundler/setup.rb -S $path_to_rspec_exe"
+
+echo "Running all..."
+
+print_and_run "$command_prefix spec --format progress --profile"
+
+echo
+echo "--------------------------------------------------------------------"
+echo
+
+for file in `find spec -iname '*_spec.rb'`; do
+ print_and_run "$command_prefix $file --format progress"
+done
+

0 comments on commit 46d5347

Please sign in to comment.