Sha256: bd6c4de98d22a9c283f7a4de4b74c83212555ae13cf15a4a7c4b013a544bcbd3
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
require_relative '../pact_helper' require 'user_app/message_builder' module UserApp describe MessageBuilder, pact: true do subject { described_class.build(subscribed_status) } describe '.build' do context 'subscribed' do let(:subscribed_status) { true } let(:user_contract) do Pact::Messages.get_message_contract('Message Provider', 'Message Consumer', 'User subscribed') end it 'matches the contract' do diff = Pact::JsonDiffer.call(user_contract, subject) puts Pact::Matchers::UnixDiffFormatter.call(diff) if diff.any? # Print a pretty diff if we fail expect(diff).to be_empty end end context 'unsubscribed' do let(:subscribed_status) { false } let(:user_contract) do Pact::Messages.get_message_contract('Message Provider', 'Message Consumer', 'User unsubscribed') end it 'matches the contract' do diff = Pact::JsonDiffer.call(user_contract, subject) puts Pact::Matchers::UnixDiffFormatter.call(diff) if diff.any? # Print a pretty diff if we fail expect(diff).to be_empty end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pact-messages-0.1.1 | example/user-app/spec/service_providers/message_builder_spec.rb |
pact-messages-0.1.0 | example/user-app/spec/service_providers/message_builder_spec.rb |