spec/spec_helper.rb in ransack-0.5.3 vs spec/spec_helper.rb in ransack-0.5.4
- old
+ new
@@ -23,6 +23,19 @@
config.before(:suite) { Schema.create }
config.before(:all) { Sham.reset(:before_all) }
config.before(:each) { Sham.reset(:before_each) }
config.include RansackHelper
+end
+
+RSpec::Matchers.define :be_like do |expected|
+ match do |actual|
+ actual.gsub(/^\s+|\s+$/, '').gsub(/\s+/, ' ').strip ==
+ expected.gsub(/^\s+|\s+$/, '').gsub(/\s+/, ' ').strip
+ end
+end
+
+RSpec::Matchers.define :have_attribute_method do |expected|
+ match do |actual|
+ actual.attribute_method?(expected)
+ end
end
\ No newline at end of file