Sha256: 6852dc5eb68c4c5f93b1b3bec355364b42e95cdeba7da987cc13a8b434e43c89

Contents?: true

Size: 1.46 KB

Versions: 15

Compression:

Stored size: 1.46 KB

Contents

require 'spec_helper'
require 'parallel_tests/cucumber/io'
require 'parallel_tests/cucumber/failures_logger'

describe ParallelTests::Cucumber::FailuresLogger do

  before do
    @output = OutputLogger.new([])
    @output.stub(:write)

    @logger1 = ParallelTests::Cucumber::FailuresLogger.new(nil, @output, nil)
    @logger2 = ParallelTests::Cucumber::FailuresLogger.new(nil, @output, nil)
    @logger3 = ParallelTests::Cucumber::FailuresLogger.new(nil, @output, nil)

    @feature1 = mock('feature', :file => "feature/path/to/feature1.feature")
    @feature2 = mock('feature', :file => "feature/path/to/feature2.feature")
    @feature3 = mock('feature', :file => "feature/path/to/feature3.feature")

    @logger1.instance_variable_set("@lines", [1, 2, 3])
    @logger2.instance_variable_set("@lines", [2, 4, 6])
    @logger3.instance_variable_set("@lines", [3, 6, 9])
  end

  it "should produce a list of lines for failing scenarios" do
    @logger1.after_feature(@feature1)
    @logger2.after_feature(@feature2)
    @logger3.after_feature(@feature3)

    output_file_contents = @output.output.join("\n").concat("\n")

    output_file_contents.should == <<END
feature/path/to/feature1.feature:1
feature/path/to/feature1.feature:2
feature/path/to/feature1.feature:3
feature/path/to/feature2.feature:2
feature/path/to/feature2.feature:4
feature/path/to/feature2.feature:6
feature/path/to/feature3.feature:3
feature/path/to/feature3.feature:6
feature/path/to/feature3.feature:9
END
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
vinted-parallel_tests-0.13.3 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.13.3 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.13.2 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.13.1 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.13.0 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.12.4 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.12.3 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.12.2 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.12.1 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.12.0 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.11.6 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.11.5 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.11.4 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.11.3 spec/parallel_tests/cucumber/failure_logger_spec.rb
parallel_tests-0.11.2 spec/parallel_tests/cucumber/failure_logger_spec.rb