module Lebowski::RSpec::Util
Public Class Methods
match?(val1, val2)
click to toggle source
Will determine if the given two values match each other. If neither val1 or val2 are regular expression then then will be compared using the standard == operator. Otherwise, if val1 or val2 is a regular expression, then it will be compared against the other value that must be a string
# File lib/lebowski/rspec/util.rb, line 16 def self.match?(val1, val2) if val1.kind_of? Regexp or val2.kind_of? Regexp return (val1 =~ val2).nil? ? false : true else return val1 == val2 end end