Sha256: c7cf13176ca864b4982c0559b4aae5d5729c124b9d1c26c9bd3ccecaafb800ec

Contents?: true

Size: 696 Bytes

Versions: 3

Compression:

Stored size: 696 Bytes

Contents

require 'json'
require 'fileutils'

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

  producer_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.producer_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

3 entries across 3 versions & 1 rubygems

Version Path
pact-0.1.37 spec/features/producer_states/zebras.rb
pact-0.1.35 spec/features/producer_states/zebras.rb
pact-0.1.28 spec/features/producer_states/zebras.rb