Test Smells

Flashcard 3 of 5

Keeping our last flashcard in mind, what jumps out at you about this code?

describe PrefixedLogger do
  describe "#log" do
    it "adds a prefix to logged messages" do
      logger = double("logger")
      expect(logger).to(
        receive(:log).with("PREFIX: message")
      )
      prefixed = 
        PrefixedLogger.new(logger, "PREFIX: ")

      prefixed.log("message")
    end
  end
end

Answer:

Reveal Answer