Sha256: c260d7481059a1e918dd5cd099eca27aa6f9c48ab07a24af712bd2f56477f08b

Contents?: true

Size: 901 Bytes

Versions: 2

Compression:

Stored size: 901 Bytes

Contents

require 'spec_helper'

describe SPV::Fixtures::Converter do
  describe '.convert_raw' do
    let(:first_fixture)  { 'test_fixture' }
    let(:second_fixture) { {fixture: 'fixture_name', options: 'vcr options'} }

    subject {
      described_class.convert_raw(
        [first_fixture, second_fixture]
      )
    }

    before do
      allow(SPV::Fixture).to receive(:new).and_return('first prepared', 'second prepared')
    end

    it 'initializes first object of Fixture class' do
      expect(SPV::Fixture).to receive(:new).with(first_fixture)

      subject
    end

    it 'initializes second object of Fixture class' do
      expect(SPV::Fixture).to receive(:new).with(
        second_fixture[:fixture], second_fixture[:options]
      )

      subject
    end

    it 'returns a prepared list of fixtures' do
      expect(subject).to eq(['first prepared', 'second prepared'])
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
site_prism.vcr-0.3.0 spec/unit/fixtures/converter_spec.rb
site_prism.vcr-0.2.0 spec/unit/fixtures/converter_spec.rb