Sha256: f5dc5c2634b0829e677138694cdb92e1012fd4ccf22698cd8f78ede51ee67b0d

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

require "spec_helper"

describe "failed_results_re" do
  it "should match a failure" do
    re = Autotest::Rspec2.new.failed_results_re
    re =~ "1)\n'this example' FAILED\nreason\n/path.rb:37:\n\n"
    $1.should == "this example"
    $2.should == "reason\n/path.rb:37:"
  end

  it "should match a failure when matcher outputs multiple lines" do
    re = Autotest::Rspec2.new.failed_results_re
    re =~ "1)\n'other example' FAILED\n\nreason line 1\nreason line 2\n\n(additional info)\n/path.rb:37:\n\n"
    $1.should == "other example"
    $2.should == "reason line 1\nreason line 2\n\n(additional info)\n/path.rb:37:"
  end

  it "should match an Error" do
    re = Autotest::Rspec2.new.failed_results_re
    re =~ "1)\nRuntimeError in 'this example'\nreason\n/path.rb:37:\n\n"
    $1.should == "this example"
    $2.should == "reason\n/path.rb:37:"
  end

  it "should match an Error that doesn't end in Error" do
    re = Autotest::Rspec2.new.failed_results_re
    re =~ "1)\nInvalidArgument in 'this example'\nreason\n/path.rb:37:\n\n"
    $1.should == "this example"
    $2.should == "reason\n/path.rb:37:"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.8 spec/autotest/failed_results_re_spec.rb
rspec-core-2.0.0.beta.7 spec/autotest/failed_results_re_spec.rb
rspec-core-2.0.0.beta.6 spec/autotest/failed_results_re_spec.rb
rspec-core-2.0.0.beta.5 spec/autotest/failed_results_re_spec.rb
rspec-core-2.0.0.beta.4 spec/autotest/failed_results_re_spec.rb