Sha256: 96f48828663a1c2b61237407b718beedaf8e0d1d278ec46753db4b908d305a85
Contents?: true
Size: 1.34 KB
Versions: 14
Compression:
Stored size: 1.34 KB
Contents
require "spec_helper" describe WildcardMatchers::Matchers do [ [ "string", String ], [ 0, Integer ], [ 0.1, Float ], [ 0, Numeric ], # superclass [ { :some => :hash }, Hash ], [ [ 1, 2, 3 ], Array ], ].each do |actual, expected| it_behaves_like "wildcard match", actual, :is_a, expected end [ [ "string", :is_a_string ], [ 0, :is_a_integer ], [ 0.1, :is_a_float ], [ { :some => :hash }, :is_a_hash ], [ [ 1, 2, 3 ], :is_a_array ], # is_bool [ true, :is_bool ], [ false, :is_bool ], # is_time [ Time.now, :is_time ], [ Time.now.to_s, :is_time ], [ "2012-05-10", :is_time ], ].each do |actual, matcher| it_behaves_like "wildcard match", actual, matcher end [ [ 0, :is_bool ], ].each do |actual, matcher| it_behaves_like "not wildcard match", actual, matcher end [ [ "a", :is_a_member_of, %w[ a b ] ], [ "a", :is_a_member_of, [ String ] ], ].each do |actual, matcher, *args| it_behaves_like "wildcard match", actual, matcher, *args end [ [ "a", :is_a_member_of, %w[ b c ] ], [ "a", :is_a_member_of, [ Integer ] ], ].each do |actual, matcher, *args| it_behaves_like "not wildcard match", actual, matcher, *args end end
Version data entries
14 entries across 14 versions & 1 rubygems