Convert Emoji test to spec.

This commit is contained in:
Markus Reiter 2017-02-12 21:46:15 +01:00
parent 08c7561639
commit 6799081f8a
2 changed files with 16 additions and 11 deletions

View File

@ -0,0 +1,16 @@
require "emoji"
describe Emoji do
describe "#install_badge" do
subject { described_class.install_badge }
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

View File

@ -1,11 +0,0 @@
require "testing_env"
require "emoji"
class EmojiTest < Homebrew::TestCase
def test_install_badge
assert_equal "🍺", Emoji.install_badge
ENV["HOMEBREW_INSTALL_BADGE"] = "foo"
assert_equal "foo", Emoji.install_badge
end
end