Sha256: 0ffb503207b67070d36b2e8ff165da5b065f6e9cc7c0ee43179bcfc6ad13ca76

Contents?: true

Size: 702 Bytes

Versions: 53

Compression:

Stored size: 702 Bytes

Contents

require 'json'
require 'fileutils'

Pact.provider_states_for 'the-wild-beast-store' do

  provider_state :the_zebras_are_here do
    set_up do
      FileUtils.mkdir_p 'tmp'
      some_data = [{'name' => 'Jason'},{'name' => 'Sarah'}]
      File.open("tmp/a_mock_database.json", "w") { |file| file << some_data.to_json }
    end

    tear_down do
      FileUtils.rm_rf("tmp/a_mock_database.json")
    end
  end
end

Pact.provider_state "some other zebras are here" do
  set_up do
    some_data = [{'name' => 'Mark'},{'name' => 'Gertrude'}]
    File.open("tmp/a_mock_database.json", "w") { |file| file << some_data.to_json }
  end

  tear_down do
    FileUtils.rm_rf("tmp/a_mock_database.json")
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
pact-1.4.0.rc4 spec/features/provider_states/zebras.rb
pact-1.4.0.rc3 spec/features/provider_states/zebras.rb
pact-1.4.0.rc2 spec/features/provider_states/zebras.rb
pact-1.3.3 spec/features/provider_states/zebras.rb
pact-1.3.2 spec/features/provider_states/zebras.rb
pact-1.3.1 spec/features/provider_states/zebras.rb
pact-1.3.0 spec/features/provider_states/zebras.rb
pact-1.2.1.rc2 spec/features/provider_states/zebras.rb
pact-1.2.1.rc1 spec/features/provider_states/zebras.rb
pact-1.1.1 spec/features/provider_states/zebras.rb
pact-1.1.0 spec/features/provider_states/zebras.rb
pact-1.1.0.rc5 spec/features/provider_states/zebras.rb
pact-1.1.0.rc4 spec/features/provider_states/zebras.rb
pact-1.1.0.rc3 spec/features/provider_states/zebras.rb
pact-1.0.39 spec/features/provider_states/zebras.rb
pact-1.1.0.rc2 spec/features/provider_states/zebras.rb
pact-1.0.38 spec/features/provider_states/zebras.rb
pact-1.1.0.rc1 spec/features/provider_states/zebras.rb
pact-1.0.37 spec/features/provider_states/zebras.rb
pact-1.0.36 spec/features/provider_states/zebras.rb