Created
October 21, 2008 15:08
-
-
Save Peeja/18322 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Not (yet) functional. | |
module AssignMatcher | |
class Assign | |
def initialize(assignment) | |
@assignment = assignment | |
end | |
def matches?(target) | |
@target = target | |
@value = assigns[@assignment] | |
[email protected]? | |
end | |
def failure_message | |
"expected #{@controller_class_name} to assign to @#{@assignment}, but it didn't." | |
end | |
def negative_failure_message | |
"expected #{@controller_class_name} not to assign to @#{@assignment}, but @#{@assignment} was #{@value}" | |
end | |
end | |
def assign(assignment) | |
Assign.new(assignment) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment