Skip to content

Instantly share code, notes, and snippets.

@christianrolle
Created March 27, 2016 10:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save christianrolle/31ccc0111ed96ea4ac36 to your computer and use it in GitHub Desktop.
Save christianrolle/31ccc0111ed96ea4ac36 to your computer and use it in GitHub Desktop.
module Humanizable
attr_accessor :name
end
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
class Person
end
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