Sha256: 32a75e6b7c202bff9e217a61361ef8d859603d24deed53cf115c38bda0eed43e

Contents?: true

Size: 457 Bytes

Versions: 2

Compression:

Stored size: 457 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

shared_examples_for "an RSpec matcher" do |options|

  let(:valid_value)   { options.fetch(:valid_value) }
  let(:invalid_value) { options.fetch(:invalid_value) }

  it 'matches a valid value when using #== so it can be composed' do
    expect(matcher).to eq(valid_value)
  end

  it 'does not match an invalid value when using #== so it can be composed' do
    expect(matcher).not_to eq(invalid_value)
  end

end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ndd-rspec-0.1.1 spec/ndd/rspec/matchers/shared_examples.rb
ndd-rspec-0.1.0 spec/ndd/rspec/matchers/shared_examples.rb