Skip to content

Instantly share code, notes, and snippets.

@Peeja
Created October 21, 2008 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Peeja/18322 to your computer and use it in GitHub Desktop.
Save Peeja/18322 to your computer and use it in GitHub Desktop.
# Not (yet) functional.
module AssignMatcher
class Assign
def initialize(assignment)
@assignment = assignment
end
def matches?(target)
@target = target
@value = assigns[@assignment]
!@value.nil?
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