diff options
| author | Markus Reiter | 2017-02-15 03:33:21 +0100 | 
|---|---|---|
| committer | Markus Reiter | 2017-02-16 03:24:32 +0100 | 
| commit | 66735b91a316e2d56ad484699178496da5c83656 (patch) | |
| tree | 03f1771fae14daa0c4e44cd695cc6ae1d78372a1 /Library/Homebrew/test/descriptions_spec.rb | |
| parent | 5a2a0638028ee49991e404c1bd6397c10659474b (diff) | |
| download | brew-66735b91a316e2d56ad484699178496da5c83656.tar.bz2 | |
Convert Descriptions test to spec.
Diffstat (limited to 'Library/Homebrew/test/descriptions_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/descriptions_spec.rb | 42 | 
1 files changed, 42 insertions, 0 deletions
| diff --git a/Library/Homebrew/test/descriptions_spec.rb b/Library/Homebrew/test/descriptions_spec.rb new file mode 100644 index 000000000..e873c73b4 --- /dev/null +++ b/Library/Homebrew/test/descriptions_spec.rb @@ -0,0 +1,42 @@ +require "descriptions" + +describe Descriptions do +  subject { described_class.new(descriptions_hash) } +  let(:descriptions_hash) { {} } + +  it "can print description for a core Formula" do +    descriptions_hash["homebrew/core/foo"] = "Core foo" +    expect { subject.print }.to output("foo: Core foo\n").to_stdout +  end + +  it "can print description for an external Formula" do +    descriptions_hash["somedev/external/foo"] = "External foo" +    expect { subject.print }.to output("foo: External foo\n").to_stdout +  end + +  it "can print descriptions for duplicate Formulae" do +    descriptions_hash["homebrew/core/foo"] = "Core foo" +    descriptions_hash["somedev/external/foo"] = "External foo" + +    expect { subject.print }.to output( +      <<-EOS.undent +        homebrew/core/foo: Core foo +        somedev/external/foo: External foo +      EOS +    ).to_stdout +  end + +  it "can print descriptions for duplicate core and external Formulae" do +    descriptions_hash["homebrew/core/foo"] = "Core foo" +    descriptions_hash["somedev/external/foo"] = "External foo" +    descriptions_hash["otherdev/external/foo"] = "Other external foo" + +    expect { subject.print }.to output( +      <<-EOS.undent +        homebrew/core/foo: Core foo +        otherdev/external/foo: Other external foo +        somedev/external/foo: External foo +      EOS +    ).to_stdout +  end +end | 
