Sha256: 950e1958450ee2c8d08c4076915917b3ca176ee89589ad69e10e547607494eae

Contents?: true

Size: 1.91 KB

Versions: 13

Compression:

Stored size: 1.91 KB

Contents

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

module Cucumber
  module Formatters
    describe ProgressFormatter do
      it "should print . when passed" do
        io = StringIO.new
        formatter = ProgressFormatter.new io
        step = stub('step',
          :error => nil
        )
        formatter.step_passed(step,nil,nil)
        io.string.should =~ /^\.$/
      end

      it "should print F when failed" do
        io = StringIO.new
        formatter = ProgressFormatter.new io
        step = stub('step',
          :error => StandardError.new
        )
        formatter.step_failed(step,nil,nil)
        io.string.should =~ /^\F$/
      end

      it "should print P when pending" do
        io = StringIO.new
        formatter = ProgressFormatter.new io
        step = stub('step',
          :error => Pending.new,
          :scenario => mock('scenario')
        )
        formatter.step_pending(step,nil,nil)
        io.string.should =~ /^\P$/
      end

      it "should print _ when skipped" do
        io = StringIO.new
        formatter = ProgressFormatter.new io
        formatter.step_skipped(nil,nil,nil)
        io.string.should =~ /^_$/
      end

      describe "scenario without any steps" do
        before :each do
          @io         = StringIO.new
          @formatter  = ProgressFormatter.new(@io)
          @feature    = stub("feature", :header => "Feature Header")
          @scenario   = stub("scenario", :feature => @feature, :name => "Scenario Title", :row? => false, :pending? => true)
        end

        it "should print a P when executing" do
          @formatter.should_receive(:pending).with("P")
          @formatter.scenario_executing(@scenario)
        end

        it "should display as pending in the dump" do
          @formatter.scenario_executing(@scenario)
          @formatter.dump
          @io.string.should include("Feature Header (Scenario Title)")
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
aslakhellesoy-cucumber-0.1.10 spec/cucumber/formatters/progress_formatter_spec.rb
aslakhellesoy-cucumber-0.1.11 spec/cucumber/formatters/progress_formatter_spec.rb
aslakhellesoy-cucumber-0.1.12 spec/cucumber/formatters/progress_formatter_spec.rb
aslakhellesoy-cucumber-0.1.9 spec/cucumber/formatters/progress_formatter_spec.rb
bts-cucumber-0.1.13.1 spec/cucumber/formatters/progress_formatter_spec.rb
bts-cucumber-0.1.13.2 spec/cucumber/formatters/progress_formatter_spec.rb
bts-cucumber-0.1.13.3 spec/cucumber/formatters/progress_formatter_spec.rb
jeffrafter-cucumber-0.1.10 spec/cucumber/formatters/progress_formatter_spec.rb
jeffrafter-cucumber-0.1.12 spec/cucumber/formatters/progress_formatter_spec.rb
cucumber-0.1.12 spec/cucumber/formatters/progress_formatter_spec.rb
cucumber-0.1.11 spec/cucumber/formatters/progress_formatter_spec.rb
cucumber-0.1.10 spec/cucumber/formatters/progress_formatter_spec.rb
cucumber-0.1.9 spec/cucumber/formatters/progress_formatter_spec.rb