spec/autotest/rspec_spec.rb in rspec-1.1.3 vs spec/autotest/rspec_spec.rb in rspec-1.1.4
- old
+ new
@@ -47,11 +47,11 @@
end
describe Rspec, "selection of rspec command" do
include AutotestHelper
- before :each do
+ before(:each) do
common_setup
@rspec_autotest = Rspec.new
end
it "should try to find the spec command if it exists in ./bin and use it above everything else" do
@@ -81,11 +81,11 @@
end
describe Rspec, "selection of rspec command (windows compatibility issues)" do
include AutotestHelper
- before :each do
+ before(:each) do
common_setup
end
it "should use the ALT_SEPARATOR if it is non-nil" do
@rspec_autotest = Rspec.new
@@ -102,11 +102,11 @@
@rspec_autotest.spec_command.should == spec_command
end
end
describe Rspec, "adding spec.opts --options" do
- before :each do
+ before(:each) do
@rspec_autotest = Rspec.new
end
it "should return the command line option to add spec.opts if the options file exists" do
File.stub!(:exist?).and_return true
@@ -118,11 +118,11 @@
Rspec.new.add_options_if_present.should == ""
end
end
describe Rspec do
- before :each do
+ before(:each) do
@rspec_autotest = Rspec.new
@rspec_autotest.stub!(:ruby).and_return "ruby"
@rspec_autotest.stub!(:add_options_if_present).and_return "-O spec/spec.opts"
@ruby = @rspec_autotest.ruby
@@ -165,31 +165,33 @@
end
describe Rspec, "consolidating failures" do
include AutotestHelper
- before :each do
+ before(:each) do
common_setup
@rspec_autotest = Rspec.new
- @spec_file = "./spec/autotest/rspec_spec.rb"
+ @spec_file = "spec/autotest/rspec_spec.rb"
@rspec_autotest.instance_variable_set("@files", {@spec_file => Time.now})
@rspec_autotest.stub!(:find_files_to_test).and_return true
end
it "should return no failures if no failures were given in the output" do
@rspec_autotest.consolidate_failures([[]]).should == {}
end
it "should return a hash with the spec filename => spec name for each failure or error" do
- @rspec_autotest.stub!(:test_files_for).and_return "./spec/autotest/rspec_spec.rb"
- foo = [
+ @rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/rspec_spec.rb"
+ failures = [
[
"false should be false",
- "expected: true,\n got: false (using ==)\n./spec/autotest/rspec_spec.rb:203:"
+ "expected: true,\n got: false (using ==)\n#{@spec_file}:203:"
]
]
- @rspec_autotest.consolidate_failures(foo).should == {@spec_file => ["false should be false"]}
+ @rspec_autotest.consolidate_failures(failures).should == {
+ @spec_file => ["false should be false"]
+ }
end
end
end