Created
September 4, 2017 07:52
-
-
Save AlexVPopov/40dfddcf09cbe74a8dbbc4e1133603d4 to your computer and use it in GitHub Desktop.
This file contains 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
RSpec.describe Person do | |
let(:person) { described_class.new('Fixed', 'Name', education_level, educator) } | |
describe '#educate' do | |
let(:education_level) { 2 } | |
let(:educator) { instance_double('PersonEducator') } | |
let(:updated_education_level) { education_level + 1 } | |
subject { person.education_level } | |
before do | |
expect(educator).to receive(:educate).and_return(updated_education_level) | |
person.educate | |
end | |
it { is_expected.to eq updated_education_level } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment