Skip to content

Instantly share code, notes, and snippets.

@pdabrowski6
Created January 12, 2018 15:50
Show Gist options
  • Save pdabrowski6/af9dd155cd8af376d9e28989aa0a6521 to your computer and use it in GitHub Desktop.
Save pdabrowski6/af9dd155cd8af376d9e28989aa0a6521 to your computer and use it in GitHub Desktop.
class Example
attr_reader :context_name, :test_result
def initialize(context_name, &block)
@context_name = context_name
instance_eval &block
end
def expect(result)
@result = result
self
end
def to(expectation)
@test_result = expectation.call(result)
end
def eq(expectation)
Proc.new { |n| n.eql?(expectation) }
end
private
attr_reader :result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment