Skip to content

Instantly share code, notes, and snippets.

@noqcks
Created September 9, 2014 20:39
Show Gist options
  • Save noqcks/33257e01510d1bbdd276 to your computer and use it in GitHub Desktop.
Save noqcks/33257e01510d1bbdd276 to your computer and use it in GitHub Desktop.
require_relative 'spec_helper'
# Since a Footman is a type of Unit, it makes sense to now make Footman inherit from Unit
# Furthermore,
# This test doesn't look for it, but there are other things that you could do at this point. Think about what else you could refactor in the Footman class, now that it is inheriting functionality (code) from the Unit class.
describe Footman do
subject(:footman) { Footman.new }
it "should be a Unit" do
expect(footman).to be_an_instance_of(Footman)
# But should also be a Unit
expect(footman).to be_a(Unit)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment