From 5566ce4ea97902dd5ffeb8d52ac7f37d34b006ec Mon Sep 17 00:00:00 2001 From: Sandro Turriate Date: Mon, 6 Sep 2010 14:16:17 -0400 Subject: [PATCH] Ruby 1.9.2 support --- lib/specjour/dispatcher.rb | 14 ++++++++------ lib/specjour/rspec/distributed_formatter.rb | 2 +- spec/specjour/cli_spec.rb | 1 + spec/specjour/manager_spec.rb | 1 + spec/specjour_spec.rb | 4 +++- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/specjour/dispatcher.rb b/lib/specjour/dispatcher.rb index a05c441..69b9353 100644 --- a/lib/specjour/dispatcher.rb +++ b/lib/specjour/dispatcher.rb @@ -38,15 +38,17 @@ def find_tests end def all_specs(tests_path = 'spec') - Dir.chdir(project_path) do - Dir[File.join(tests_path, "**/*_spec.rb")].sort - end if File.exists? File.join(project_path, tests_path) + full_path = File.join(project_path, tests_path) + if File.exists? full_path + Dir[File.join(full_path, "**/*_spec.rb")].sort + end end def all_features(tests_path = 'features') - Dir.chdir(project_path) do - Dir[File.join(tests_path, "**/*.feature")].sort - end if File.exists? File.join(project_path, tests_path) + full_path = File.join(project_path, tests_path) + if File.exists? full_path + Dir[File.join(full_path, "**/*.feature")].sort + end end def add_manager(manager) diff --git a/lib/specjour/rspec/distributed_formatter.rb b/lib/specjour/rspec/distributed_formatter.rb index 129ed26..fb81686 100644 --- a/lib/specjour/rspec/distributed_formatter.rb +++ b/lib/specjour/rspec/distributed_formatter.rb @@ -64,7 +64,7 @@ def to_hash protected def print_and_flush(messages) - output.print messages.to_s + output.print messages.join output.flush messages.replace [] end diff --git a/spec/specjour/cli_spec.rb b/spec/specjour/cli_spec.rb index 5854d97..ffb6ccb 100644 --- a/spec/specjour/cli_spec.rb +++ b/spec/specjour/cli_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' describe Specjour::CLI do + subject { Specjour::CLI.new } let(:fake_pid) { 100_000_000 } before do stub(Specjour::CPU).cores.returns(27) diff --git a/spec/specjour/manager_spec.rb b/spec/specjour/manager_spec.rb index 91ccc97..31dd547 100644 --- a/spec/specjour/manager_spec.rb +++ b/spec/specjour/manager_spec.rb @@ -2,6 +2,7 @@ describe Specjour::Manager do describe "#available_for?" do + subject { Specjour::Manager.new } it "isn't available for all projects by default" do subject.available_for?(rand.to_s).should be_false end diff --git a/spec/specjour_spec.rb b/spec/specjour_spec.rb index 2af794d..f362d30 100644 --- a/spec/specjour_spec.rb +++ b/spec/specjour_spec.rb @@ -8,7 +8,9 @@ def boo end describe Specjour do - it "pends as an example" + it "pends as an example" do + pending + end it "fails as an example" do boo