Sha256: b8061f1d499c43851f40638eb26ef2a305d506a4328f2b0eeacce61910f0e1dd

Contents?: true

Size: 590 Bytes

Versions: 5

Compression:

Stored size: 590 Bytes

Contents

require 'spec'
require File.dirname(__FILE__) + '/../init'

Spec::Runner.configure do |config|
  
end

class OnlyContain
  def initialize(*expected)
    @expected = [expected].flatten
  end

  def matches?(target)
     @target = target.dup
     @expected.each do |e|
       target.gsub!(e, '')
     end
     target.size == 0
  end

  def failure_message
    "expected #{@target} to only contain #{@expected.join(', ')}"
  end

  def failure_message
    "expected #{@target} to not only contain #{@expected.join(', ')}"
  end
end

def only_contain(*expected)
  OnlyContain.new(expected)
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
sevenwire-forgery-0.2.0 spec/spec_helper.rb
sevenwire-forgery-0.2.1 spec/spec_helper.rb
sevenwire-forgery-0.2.2 spec/spec_helper.rb
forgery-0.3.0 spec/spec_helper.rb
forgery-0.2.2 spec/spec_helper.rb