Skip to content

Instantly share code, notes, and snippets.

@jimweirich
Created July 19, 2013 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimweirich/6034334 to your computer and use it in GitHub Desktop.
Save jimweirich/6034334 to your computer and use it in GitHub Desktop.
Argument matching
require 'rspec/given'
class Array
def ===(other)
size == other.size &&
zip(other).all? { |a, b| a === b }
end
end
describe "Arg Matching" do
Then { [Fixnum, Float] === [1, 2.0] }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment