Sha256: 924f1d627f28d9dda6bff5bbd505ea11bd5ef8a19001930970cea6f3a367b043

Contents?: true

Size: 1010 Bytes

Versions: 30

Compression:

Stored size: 1010 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

module Cucumber::Formatters
  describe AutotestFormatter do
    before(:each) do
      @io        = StringIO.new
      @formatter = AutotestFormatter.new @io
      @scenario  = mock('scenario', :name => "Doing tricky things")
      @step      = mock('step', :scenario => @scenario)
    end

    %w{failed skipped pending}.each do |didnt_pass|
      it "should print a scenario's name when it has a #{didnt_pass} step" do
        @formatter.send("step_#{didnt_pass}".to_sym, @step, mock('regexp'), mock('args'))
        @io.string.should == "Doing tricky things\n"
      end
    end

    it "should not print the same scenario's name twice" do
      another_step = mock('another step', :scenario => @scenario)
      @formatter.send("step_failed".to_sym, @step,         mock('regexp'), mock('args'))
      @formatter.send("step_skipped".to_sym, another_step, mock('regexp'), mock('args'))
      @io.string.should == "Doing tricky things\n"
    end
  end
end

Version data entries

30 entries across 30 versions & 5 rubygems

Version Path
aslakhellesoy-cucumber-0.1.10 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.11 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.12 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.13.2 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.13.3 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.13 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.14.1 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.14.2 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.15 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.16.1 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.16.2 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.16.3 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.16.4 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.16 spec/cucumber/formatters/autotest_formatter_spec.rb
aslakhellesoy-cucumber-0.1.9 spec/cucumber/formatters/autotest_formatter_spec.rb
bts-cucumber-0.1.13.1 spec/cucumber/formatters/autotest_formatter_spec.rb
bts-cucumber-0.1.13.2 spec/cucumber/formatters/autotest_formatter_spec.rb
bts-cucumber-0.1.13.3 spec/cucumber/formatters/autotest_formatter_spec.rb
jeffrafter-cucumber-0.1.10 spec/cucumber/formatters/autotest_formatter_spec.rb
jeffrafter-cucumber-0.1.12 spec/cucumber/formatters/autotest_formatter_spec.rb