Sha256: 6810e969d03b2d5404fc62a289f7004fc452b76c0d5b489477028c1c7d90811e

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'
require 'turnip_formatter/printer/scenario'

module TurnipFormatter::Printer
  describe Scenario do
    include_context 'turnip_formatter scenario setup'
    include_context 'turnip_formatter standard scenario metadata'

    let(:scenario) do
      TurnipFormatter::Scenario::Pass.new(example)
    end

    context 'turnip example' do
      describe '.print_out' do
        subject { Scenario.print_out(scenario) }

        it { should have_tag 'a', with: { href: '#' + scenario.id } }
        it { should have_tag 'span.scenario_name', text: /Scenario: Scenario/ }
        it { should have_tag 'span.feature_name' }
        it { should have_tag 'ul.tags' }
        it { should have_tag 'ul.steps' }
      end
    end

    context 'not turnip example' do
      describe '.print_out' do
        before do
          scenario.stub(:validation) { raise NoFeatureFileError }
          RuntimeError.should_receive(:print_out)
        end

        it { Scenario.print_out(scenario) }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
turnip_formatter-0.2.9 spec/turnip_formatter/printer/scenario_spec.rb
turnip_formatter-0.2.8 spec/turnip_formatter/printer/scenario_spec.rb
turnip_formatter-0.2.7 spec/turnip_formatter/printer/scenario_spec.rb
turnip_formatter-0.2.6 spec/turnip_formatter/printer/scenario_spec.rb
turnip_formatter-0.2.5 spec/turnip_formatter/printer/scenario_spec.rb
turnip_formatter-0.2.4 spec/turnip_formatter/printer/scenario_spec.rb