Created
January 12, 2018 15:50
-
-
Save pdabrowski6/af9dd155cd8af376d9e28989aa0a6521 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
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