Sha256: 2f29ccef69271a59d4514b9db793469463065c9de032c0634ef118249e1ff6ce

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

module TurnipFormatter
  class Step
    describe Failure do
      include_context 'turnip_formatter standard step parameters'
      include_context 'turnip_formatter pending scenario setup'
      include_context 'turnip_formatter standard scenario metadata'

      let(:step) do
        step = ::TurnipFormatter::Step.new(example, description)
        step.extend TurnipFormatter::Step::Pending
        step
      end

      it 'exists built-in step template' do
        templates = TurnipFormatter::Step::Pending.templates
        expect(templates.keys).to eq([:exception])
      end

      context 'add custom step template' do
        before do
          TurnipFormatter::Step::Pending.add_template :custom do
            example.example_group.description
          end
        end

        after do
          TurnipFormatter::Step::Failure.remove_template :custom
        end

        it 'should get custom step template' do
          templates = TurnipFormatter::Step::Pending.templates
          expect(templates.keys).to eq([:exception, :custom])
        end
      end

      describe '#attention?' do
        subject { step.attention? }
        it { should be_true }
      end

      describe '#status' do
        subject { step.status }
        it { should eq :pending }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
turnip_formatter-0.1.2 spec/turnip_formatter/step/pending_spec.rb
turnip_formatter-0.1.1 spec/turnip_formatter/step/pending_spec.rb
turnip_formatter-0.1.0 spec/turnip_formatter/step/pending_spec.rb
turnip_formatter-0.0.6 spec/turnip_formatter/step/pending_spec.rb