Sha256: bb23e5b1f1d3d326a69cbf355a153517575e392463e1bc09a420079e1b54c4d2

Contents?: true

Size: 1.11 KB

Versions: 19

Compression:

Stored size: 1.11 KB

Contents

require 'autotest/autotest_helper'

describe "failed_results_re" do
  it "should match a failure" do
    re = Autotest::Rspec.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::Rspec.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::Rspec.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::Rspec.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

19 entries across 19 versions & 7 rubygems

Version Path
rspec-instructure-1.3.3 spec/autotest/failed_results_re_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/spec/autotest/failed_results_re_spec.rb
rspec-1.3.2 spec/autotest/failed_results_re_spec.rb
rspec-1.3.1 spec/autotest/failed_results_re_spec.rb
rspec-1.3.1.rc spec/autotest/failed_results_re_spec.rb
rspec-1.3.0 spec/autotest/failed_results_re_spec.rb
media-path-0.1.2 vendor/rspec/spec/autotest/failed_results_re_spec.rb
simple-templater-0.0.1.3 vendor/rspec/spec/autotest/failed_results_re_spec.rb
pupu-0.0.2.pre vendor/rspec/spec/autotest/failed_results_re_spec.rb
media-path-0.1.1.pre vendor/rspec/spec/autotest/failed_results_re_spec.rb
simple-templater-0.0.1.2 vendor/rspec/spec/autotest/failed_results_re_spec.rb
media-path-0.1.1 vendor/rspec/spec/autotest/failed_results_re_spec.rb
simple-templater-0.0.1.1 vendor/rspec/spec/autotest/failed_results_re_spec.rb
pupu-0.0.2 vendor/rspec/spec/autotest/failed_results_re_spec.rb
rango-0.0.6 vendor/rspec/spec/autotest/failed_results_re_spec.rb
rango-0.1.pre vendor/rspec/spec/autotest/failed_results_re_spec.rb
pupu-0.0.1 vendor/rspec/spec/autotest/failed_results_re_spec.rb
media-path-0.1 vendor/rspec/spec/autotest/failed_results_re_spec.rb
simple-templater-0.0.1 vendor/rspec/spec/autotest/failed_results_re_spec.rb