Permalink
Browse files

Make it work with other test helpers

  • Loading branch information...
1 parent b547779 commit c288a3ed8a0b022b95482c2c18c10ce71530f0c8 @semaperepelitsa committed Sep 25, 2012
Showing with 27 additions and 2 deletions.
  1. +10 −1 Rakefile
  2. +4 −1 lib/spork/test_framework/minitest.rb
  3. +7 −0 spec_project/spec/some_spec.rb
  4. +6 −0 spec_project/spec/spec_helper.rb
View
@@ -41,6 +41,15 @@ task "test:unit" do
end
end
-task :test => "test:unit"
+task "test:spec" do
+ cd "spec_project" do
+ running({"HELPER_FILE" => "spec/spec_helper.rb"}, "bundle exec spork minitest") do
+ prompt_wait "Press return when spork is loaded"
+ testdrb "spec/some_spec.rb"
+ end
+ end
+end
+
+task :test => ["test:unit", "test:spec"]
task :default => :test
@@ -1,6 +1,9 @@
class Spork::TestFramework::MiniTest < Spork::TestFramework
DEFAULT_PORT = 8988
- HELPER_FILE = File.join(Dir.pwd, "test/test_helper.rb")
+
+ def self.helper_file
+ ENV['HELPER_FILE'] || "test/test_helper.rb"
+ end
def run_tests(argv, stderr, stdout)
require "minitest/unit"
@@ -0,0 +1,7 @@
+require "spec_helper"
+
+describe "Something" do
+ it "is fine" do
+ true.must_equal true
+ end
+end
@@ -0,0 +1,6 @@
+require "spork"
+$LOAD_PATH << "spec"
+
+Spork.prefork do
+ require "minitest/spec"
+end

0 comments on commit c288a3e

Please sign in to comment.