lib/wildcard_matchers/helpers.rb in wildcard_matchers-0.1.1 vs lib/wildcard_matchers/helpers.rb in wildcard_matchers-0.1.2
- old
+ new
@@ -1,6 +1,15 @@
-module WildcardMathcers
+module WildcardMatchers
module Helpers
+ class << self
+ def define_wildcard_helper(name)
+ define_method(name) do |expectation = nil, &block|
+ expectation = block_given? ? block : expectation
+
+ ::WildcardMatchers::Helpers.const_get(name.to_s.camelcase(:upper)).new(expectation)
+ end
+ end
+ end
end
end
require "wildcard_matchers/helpers/for_all"
require "wildcard_matchers/helpers/nil_or"