spec/autotest/rspec_spec.rb in rspec-1.1.11 vs spec/autotest/rspec_spec.rb in rspec-1.1.12

- old
+ new

@@ -1,43 +1,9 @@ require File.dirname(__FILE__) + "/autotest_helper" class Autotest - module AutotestHelper - def rspec_output - <<-HERE -.............PPF - -1) -'false should be false' FAILED -expected: true, - got: false (using ==) -./spec/autotest/rspec_spec.rb:203: - -Finished in 0.158674 seconds - -16 examples, 1 failure, 2 pending - -Pending: -Autotest::Rspec handling failed results should return an array of failed examples and errors (TODO) -Autotest::Rspec tests/specs for a given file should find all the specs for a given file (TODO) -HERE - end - - def common_setup - @proc = mock Proc - @kernel = mock Kernel - @kernel.stub!(:proc).and_return @proc - - File.stub!(:exists).and_return true - @windows_alt_separator = "\\" - @posix_separator = '/' - - @rspec_output = rspec_output - end - end - describe Rspec do describe "adding spec.opts --options" do before(:each) do @rspec_autotest = Rspec.new end @@ -58,10 +24,11 @@ @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 + @spec_cmd = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec')) @options = @rspec_autotest.add_options_if_present @files_to_test = { :spec => ["file_one", "file_two"] } # this is not the inner representation of Autotest! @@ -69,11 +36,11 @@ @files_to_test.stub!(:keys).and_return @files_to_test[:spec] @to_test = @files_to_test.keys.flatten.join ' ' end it "should make the appropriate test command" do - @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} -S #{@to_test} #{@options}" + @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} #{@spec_cmd} #{@to_test} #{@options}" end it "should return a blank command for no files" do @rspec_autotest.make_test_cmd({}).should == '' end @@ -104,13 +71,10 @@ @rspec_autotest.should map_specs([]).to("lib/untracked_file") end end describe "consolidating failures" do - include AutotestHelper - before(:each) do - common_setup @rspec_autotest = Rspec.new @spec_file = "spec/autotest/some_spec.rb" @rspec_autotest.instance_variable_set("@files", {@spec_file => Time.now}) @rspec_autotest.stub!(:find_files_to_test).and_return true