Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesniakania/21b5454655d37761d6293e64f0c93314 to your computer and use it in GitHub Desktop.
Save lesniakania/21b5454655d37761d6293e64f0c93314 to your computer and use it in GitHub Desktop.
class Garden
def initialize(gardener)
gardener.set_workday(Workday.new)
gardener.set_boots(BootsWithMassiveStaticInitBlock.new)
@gardener = gardener
end
end
class Gardener
def set_workday(workday)
@workday = workday
end
def set_boots(boots)
@boots = boots
end
def working?
# ...
end
end
describe Gardener do
let(:gardener) { Gardener.new }
let(:garden) { Garden.new(gardener) }
describe "#working?" do
before { AphidPlague.new(garden).infect }
it { expect(gardener.working?).to be true }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment