Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow passing in a Regex to the validate_format_of matcher #12

Merged
merged 1 commit into from

4 participants

@chancancode
Collaborator

No description provided.

@travisbot

This pull request passes (merged fc103ee into 4c910e8).

@gr4y gr4y merged commit de28684 into from
@gr4y
Collaborator

Thank you for your contribution! We really appreciate your work!

@frodsan
Owner

Can we add a test to this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/matchers/validations/format.rb
View
4 lib/matchers/validations/format.rb
@@ -35,7 +35,7 @@ def description
private
def check_valid_value
- if format =~ @valid
+ if format == @valid || format =~ @valid
@positive_message << " with #{@valid.inspect} as a valid value"
else
@negative_message << " with #{@valid.inspect} as an invalid value"
@@ -44,7 +44,7 @@ def check_valid_value
end
def check_invalid_value
- if !(format =~ @invalid)
+ if format !~ @invalid
@positive_message << " with #{@invalid.inspect} as a invalid value"
else
@negative_message << " with #{@invalid.inspect} as a valid value"
Something went wrong with that request. Please try again.