Sha256: 1450f9c365c8176e9645b6a5c2393b969ac90577c2c5cdb8eedf13dfe22e1abf
Contents?: true
Size: 914 Bytes
Versions: 59
Compression:
Stored size: 914 Bytes
Contents
require 'spec_helper' require 'pact/matchers/type_difference' module Pact module Matchers describe TypeDifference do describe "#as_json" do let(:expected) { ExpectedType.new("Fred") } let(:actual) { ActualType.new(1) } subject { TypeDifference.new expected, actual } context "when the actual is a KeyNotFound" do let(:actual) { KeyNotFound.new } let(:expected_hash) { {:EXPECTED_TYPE => "String", :ACTUAL => actual.to_s } } it "use the key ACTUAL" do expect(subject.as_json).to eq(expected_hash) end end context "when the actual is an ActualType" do let(:expected_hash) { {:EXPECTED_TYPE => "String", :ACTUAL_TYPE => "Fixnum" } } it "uses the key ACTUAL_TYPE" do expect(subject.as_json).to eq(expected_hash) end end end end end end
Version data entries
59 entries across 59 versions & 2 rubygems