Sha256: 9ae6887d2a3e5bb71808af5c83d609a1843a6f8d1e7ebca5186d6e8338c9e94e

Contents?: true

Size: 607 Bytes

Versions: 4

Compression:

Stored size: 607 Bytes

Contents

require 'spec_helper'

describe Comparator do

  context ".diff" do

    it "should respect optional arguments when doing a diff on matchers" do

      HashDealer.define(:comparator_with_options) do
        required_val("val")
        optional_val("opt", optional: true)
      end

      matcher = HashDealer.roll(:comparator_with_options).matcher

      Comparator.diff(matcher, {:required_val => "x", :optional_val => "y"}).should eql({})

      Comparator.diff(matcher, {:required_val => "x"}).should eql({})
      Comparator.diff(matcher, {:optional_val => "x"}).should_not eql({})


    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hash_dealer-1.6.2 spec/lib/comparator_spec.rb
hash_dealer-1.6.1 spec/lib/comparator_spec.rb
hash_dealer-1.6.0 spec/lib/comparator_spec.rb
hash_dealer-1.5.2 spec/lib/comparator_spec.rb