mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
have to manually require matcher now because the presence of the Spec
namespace caused issues for shoulda when not using rspec:wq
This commit is contained in:
@@ -2,7 +2,6 @@ require 'validates_timeliness/formats'
|
||||
require 'validates_timeliness/parser'
|
||||
require 'validates_timeliness/validator'
|
||||
require 'validates_timeliness/validation_methods'
|
||||
require 'validates_timeliness/spec/rails/matchers/validate_timeliness' if ENV['RAILS_ENV'] == 'test'
|
||||
|
||||
require 'validates_timeliness/active_record/attribute_methods'
|
||||
require 'validates_timeliness/active_record/multiparameter_attributes'
|
||||
|
||||
1
lib/validates_timeliness/matcher.rb
Normal file
1
lib/validates_timeliness/matcher.rb
Normal file
@@ -0,0 +1 @@
|
||||
require 'validates_timeliness/spec/rails/matchers/validate_timeliness'
|
||||
@@ -28,13 +28,12 @@ module Spec
|
||||
|
||||
valid = test_validity
|
||||
|
||||
valid = test_option(:equal_to) if @options[:equal_to] && valid
|
||||
valid = test_option(:before) if @options[:before] && valid
|
||||
valid = test_option(:after) if @options[:after] && valid
|
||||
valid = test_option(:on_or_before) if @options[:on_or_before] && valid
|
||||
valid = test_option(:on_or_after) if @options[:on_or_after] && valid
|
||||
|
||||
valid = test_between if @options[:between] && valid
|
||||
valid = test_option(:equal_to) if valid && @options[:equal_to]
|
||||
valid = test_option(:before) if valid && @options[:before]
|
||||
valid = test_option(:after) if valid && @options[:after]
|
||||
valid = test_option(:on_or_before) if valid && @options[:on_or_before]
|
||||
valid = test_option(:on_or_after) if valid && @options[:on_or_after]
|
||||
valid = test_between if valid && @options[:between]
|
||||
|
||||
return valid
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user