Skip to content

Commit

Permalink
Adds support for spinning with rspec2
Browse files Browse the repository at this point in the history
This also resolves the issues with having spec/ in the LOAD_PATH since
rspec2 adds that automagically :/

Fixes #1
Fixes #2
  • Loading branch information
jstorimer committed Nov 1, 2011
1 parent f111c48 commit 87d68ee
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bin/spin
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,18 @@ def serve
puts
puts "Loading #{file}"

# We require the full path of the file here in the child process.
require File.expand_path file
# Unfortunately rspec's interface isn't as simple as just requiring the
# test file that you want to run (suddenly test/unit seems like the less
# crazy one!).
if defined?(RSpec)
# We pretend the filepath came in as an argument and duplicate the
# behaviour of the `rspec` binary.
ARGV.push file
require 'rspec/autorun'
else
# We require the full path of the file here in the child process.
require File.expand_path file
end
end

# We don't want the parent process handling multiple test runs at the same
Expand Down

0 comments on commit 87d68ee

Please sign in to comment.