Sha256: 285b6736dc9844f64c143ff3cfabd22c41429366221e41db3e3e7a4a3c654ab1

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 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::TDLWalker.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.3.3 spec/lucid/progress_spec.rb
lucid-0.3.0 spec/lucid/progress_spec.rb