Created
March 27, 2016 10:27
-
-
Save christianrolle/31ccc0111ed96ea4ac36 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
module Humanizable | |
attr_accessor :name | |
end |
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
require 'spec_helper.rb' | |
class HumanizableUnit | |
include Humanizable | |
end | |
describe Humanizable do | |
subject { HumanizableUnit.new } | |
describe 'attribute accessors' do | |
it 'should have a name' do | |
subject.name = 'Alice' | |
expect(subject.name).to eq('Alice') | |
end | |
end | |
end |
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
class Person | |
end |
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
require 'spec_helper.rb' | |
describe Person do | |
it_behaves_like Humanizable | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment