Sha256: 0c22ee5aa1f742899d6fd2af3bf476cc2d174c2bc9f1472f60342e79fce1ef7f

Contents?: true

Size: 902 Bytes

Versions: 3

Compression:

Stored size: 902 Bytes

Contents

require 'spec_helper'
require 'gnawrnip/rspec'

module Gnawrnip
  describe 'Rspec' do
    let(:example) do
      example = group.example('example', {}) { expect(true).to be_false }
      group.run(
        Class.new do
          def self.method_missing(name, *args, &block)
            # nooooooop
          end
        end
      )
      example
    end

    context '"turnip" spec group' do
      let(:group) do
        ::RSpec::Core::ExampleGroup.describe('Feature', turnip: true)
      end

      it 'should save screen shot at error' do
        expect(example.metadata[:gnawrnip][:screenshot]).to eq "c2NyZWVuc2hvdA==\n"
      end
    end

    context 'Not "turnip" spec group' do
      let(:group) do
        ::RSpec::Core::ExampleGroup.describe('Feature')
      end

      it 'should not save screen shot' do
        expect(example.metadata).not_to include(:gnawrnip)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gnawrnip-0.0.4 spec/gnawrnip/rspec_spec.rb
gnawrnip-0.0.3 spec/gnawrnip/rspec_spec.rb
gnawrnip-0.0.2 spec/gnawrnip/rspec_spec.rb