Permalink
Browse files

Added docs

  • Loading branch information...
mjackson committed Feb 7, 2011
1 parent a14b74f commit 1b72227a3d6b823216dd3accac5d904d739912ea
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/citrus.rb
View
@@ -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

0 comments on commit 1b72227

Please sign in to comment.