Sha256: da3cef897e83f5baa5ab684e580fc58451f4668d3ad141ad78255f80db4104ef

Contents?: true

Size: 825 Bytes

Versions: 1

Compression:

Stored size: 825 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe 'have_key' do
  subject do
    Article.new
  end
  
  describe 'messages' do

    it 'should contain a description' do
      matcher = have_key(:title, :type => String)
      matcher.description.should == 'have key(s) title'
    end

    it 'should set has_key? message' do
      matcher = have_key(:owner, :type => String)
      matcher.matches?(subject)
      matcher.failure_message.should == 'Expected Article to have key named owner with type String'
    end

  end
  
  describe 'matchers' do
    it { should have_key(:title, :type => String) }
    it { should have_keys(:title, :body, :type => String) }
  end

  describe 'macros' do
    should_have_key :title, :type => String
    should_have_keys :title, :body, :type => String
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yeastymobs-remarkable_mongomapper-0.0.1 spec/matchers/have_key_matcher_spec.rb