Created
October 28, 2016 15:19
-
-
Save nelsonsar/cadb79d1a3d96168473cb942488c0439 to your computer and use it in GitHub Desktop.
Exemplo de mock
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
require 'spec_helper' | |
describe Employee do | |
describe '#salary' do | |
it 'return amount based on employee region' do | |
region = double | |
expect(region).to receive(:salary_by) | |
.with('Nelson').and_return(5000) | |
employee = Employee.new('Nelson', region) | |
expect(employee.salary).to eq(5000) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment