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