Sha256: 424a58dd751ab3687fdc3b36cd1e54413aa4551442450a3df597bc784dd0d52f

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 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

1 entries across 1 versions & 1 rubygems

Version Path
sevenwire-forgery-0.1.0 spec/spec_helper.rb