Sha256: 6501d462006e47a4263bdb337e36d7fe10d6655f3861b7a17141615ecf1ace25

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'
require 'cucumber/formatter/progress'

module Cucumber
  module Formatter
    describe Progress do

      before(:each) do
        Cucumber::Term::ANSIColor.coloring = false
        @out = StringIO.new
        progress = Cucumber::Formatter::Progress.new(mock("step mother"), @out, {})
        @visitor = Cucumber::Ast::TreeWalker.new(nil, [progress])
      end

      describe "visiting a table cell value without a status" do
        it "should take the status from the last run step" do
          @visitor.visit_step_result('', '', nil, :failed, nil, 10, nil, nil)
          outline_table = mock()
          outline_table.should_receive(:accept) do |visitor|
            visitor.visit_table_cell_value('value', nil)
          end
          @visitor.visit_outline_table(outline_table)

          @out.string.should == "FF"
        end
      end

      describe "visiting a table cell which is a table header" do
        it "should not output anything" do
          @visitor.visit_table_cell_value('value', :skipped_param)

          @out.string.should == ""
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cucumber-1.3.2 spec/cucumber/formatter/progress_spec.rb
cucumber-1.3.1 spec/cucumber/formatter/progress_spec.rb
cucumber-1.3.0 spec/cucumber/formatter/progress_spec.rb
cucumber-1.2.5 spec/cucumber/formatter/progress_spec.rb
cucumber-1.2.3 spec/cucumber/formatter/progress_spec.rb
cucumber-1.2.2 spec/cucumber/formatter/progress_spec.rb