Sha256: d064689866c8a9f6da401a39bc31648207bc525f9453f339740b315d212559f3

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

require_relative '../spec_helper'
require 'lucid/formatter/progress'

module Lucid
  module Formatter
    describe Progress do

      before(:each) do
        Lucid::Term::ANSIColor.coloring = false
        @out = StringIO.new
        progress = Lucid::Formatter::Progress.new(double('Runtime'), @out, {})
        @visitor = Lucid::AST::Walker.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
          step_result = AST::StepResult.new('', '', nil, :failed, nil, 10, nil, nil)
          step_result.accept(@visitor)
          @visitor.visit_outline_table(double) do
            @visitor.visit_table_cell_value('value', nil)
          end
          @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

2 entries across 2 versions & 1 rubygems

Version Path
lucid-0.4.1 spec/lucid/progress_spec.rb
lucid-0.4.0 spec/lucid/progress_spec.rb