Sha256: 84e87f588507f501cb7b253f290b547e58978f0ed23c625e90c99c82fb445d24

Contents?: true

Size: 1.31 KB

Versions: 4

Compression:

Stored size: 1.31 KB

Contents

require "helper"

MinitestVcr::Spec.configure!

describe MinitestVcr::Spec do

  describe 'a describe with metadata', :vcr do
    describe 'with a nested example group' do
      before do
        conn = Faraday.new
        @response = conn.get 'http://example.com'
      end
      it 'uses a cassette for any examples' do
        (VCR.current_cassette.name.split('/')).must_equal([
          'MinitestVcr::Spec',
          'a describe with metadata',
          'with a nested example group',
          'uses a cassette for any examples'
        ])
      end
    end
  end

  describe 'an it with metadata' do
    describe 'with a nested example group' do
      before do
        conn = Faraday.new
        @response = conn.get 'http://example.com'
      end
      it 'uses a cassette for any examples', :vcr do
        (VCR.current_cassette.name.split('/')).must_equal([
          'MinitestVcr::Spec',
          'an it with metadata',
          'with a nested example group',
          'uses a cassette for any examples'
        ])
      end
    end
  end

  describe "#configure!", :vcr do

    before do
      ::MiniTest::Spec.expects(:before).with(:each)
      ::MiniTest::Spec.expects(:after).with(:each)
    end

    it "should call before and after with proper args and block" do
      MinitestVcr::Spec.configure!
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
minitest-vcr-0.1.1 test/minitest-vcr/spec_test.rb
minitest-vcr-0.1.0 test/minitest-vcr/spec_test.rb
minitest-vcr-0.0.4 test/minitest-vcr/spec_test.rb
minitest-vcr-0.0.3 test/minitest-vcr/spec_test.rb