Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added docs

  • Loading branch information...
commit 1b72227a3d6b823216dd3accac5d904d739912ea 1 parent a14b74f
@mjackson authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/citrus.rb
View
10 lib/citrus.rb
@@ -670,6 +670,11 @@ def to_s
end
end
+ # This alias allows strings to be compared to the string representation of
+ # Rule objects. It is most useful in assertions in unit tests, e.g.:
+ #
+ # assert_equal('"a" | "b"', rule)
+ #
alias_method :to_str, :to_s
# Returns the Citrus notation of this rule as a string that is suitable to
@@ -1287,6 +1292,11 @@ def to_s
@string
end
+ # This alias allows strings to be compared to the string value of Match
+ # objects. It is most useful in assertions in unit tests, e.g.:
+ #
+ # assert_equal("a string", match)
+ #
alias_method :to_str, :to_s
# The default value for a match is its string value. This method is
Please sign in to comment.
Something went wrong with that request. Please try again.