Created
January 12, 2018 15:43
-
-
Save pdabrowski6/d8dcafd58e66f9f63eda71d32fe7870f 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 | |
def initialize(context_name, &block) | |
@context_name = context_name | |
instance_eval &block | |
end | |
def expect(result) | |
@result = result | |
self | |
end | |
def to(expectation) | |
self | |
end | |
def eq(expectation) | |
Proc.new { |n| n.eql?(expectation) } | |
end | |
private | |
attr_reader :result | |
end | |
describe NumberService do | |
describe '#number' do | |
it 'returns 12' do | |
expect(NumberService.new.number).to eq(12) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment