brew/Library/Homebrew/test/emoji_spec.rb
Misty De Meo 2dc5bbf535 emoji tests: make sure to unset install badge env vars
Otherwise the user's specified emoji will be used and the test will
fail.
2017-02-28 08:14:21 +11:00

22 lines
466 B
Ruby

require "emoji"
describe Emoji do
describe "#install_badge" do
subject { described_class.install_badge }
before(:each) do
ENV.delete("HOMEBREW_NO_EMOJI")
ENV.delete("HOMEBREW_INSTALL_BADGE")
end
it "returns 🍺 by default" do
expect(subject).to eq "🍺"
end
it "returns the contents of HOMEBREW_INSTALL_BADGE if set" do
ENV["HOMEBREW_INSTALL_BADGE"] = "foo"
expect(subject).to eq "foo"
end
end
end