Sha256: d5740bf7c1a7416ec6362b4007fff80f71081ac33e52d9f8784bc0330826700f

Contents?: true

Size: 1.28 KB

Versions: 10

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'

describe ParallelTests::RSpec::SummaryLogger do
  let(:output){ OutputLogger.new([]) }
  let(:logger){ ParallelTests::RSpec::SummaryLogger.new(output) }

  def decolorize(string)
    string.gsub(/\e\[\d+m/,'')
  end

  # TODO somehow generate a real example with an exception to test this
  xit "prints failing examples" do
    logger.example_failed XXX
    logger.example_failed XXX
    logger.dump_failures
    output.output.should == [
      "bundle exec rspec ./spec/path/to/example.rb:123 # should do stuff",
      "bundle exec rspec ./spec/path/to/example.rb:125 # should not do stuff"
    ]
  end

  it "does not print anything for passing examples" do
    logger.example_passed mock(:location => "/my/spec/foo.rb:123")
    logger.dump_failures
    output.output.should == []
    logger.dump_summary(1,2,3,4)
    output.output.map{|o| decolorize(o) }.should == ["\nFinished in 1 seconds\n", "2 examples, 3 failures, 4 pending"]
  end

  it "does not print anything for pending examples" do
    logger.example_pending mock(:location => "/my/spec/foo.rb:123")
    logger.dump_failures
    output.output.should == []
    logger.dump_summary(1,2,3,4)
    output.output.map{|o| decolorize(o) }.should == ["\nFinished in 1 seconds\n", "2 examples, 3 failures, 4 pending"]
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
parallel_tests-0.8.14 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.13 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.12 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.11 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.10 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.9 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.8 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.7 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.6 spec/parallel_tests/rspec/summary_logger_spec.rb
parallel_tests-0.8.5 spec/parallel_tests/rspec/summary_logger_spec.rb