From 2080c360e26868efc08a0603c507a0be44c37b67 Mon Sep 17 00:00:00 2001 From: Nath Tumlin Date: Mon, 13 Mar 2017 17:52:32 -0500 Subject: Added tests for highlight installed and fixed style errors --- Library/Homebrew/test/cask/cli/search_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Library/Homebrew/test/cask/cli') diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb index 0bcff809a..cc4e0ae63 100644 --- a/Library/Homebrew/test/cask/cli/search_spec.rb +++ b/Library/Homebrew/test/cask/cli/search_spec.rb @@ -56,4 +56,16 @@ describe Hbc::CLI::Search, :cask do Hbc::CLI::Search.run("caskroom") }.to output(/^No Cask found for "caskroom"\.\n/).to_stdout end + + it "doesn't highlight not installed packages" do + expect(Hbc::CLI::Search.highlight_installed "local-caffeine").to eq("local-caffeine") + end + + it "highlights installed packages" do + shutup do + Hbc::CLI::Install.run("local-caffeine") + end + + expect(Hbc::CLI::Search.highlight_installed "local-caffeine").to eq(pretty_installed "local-caffeine") + end end -- cgit v1.2.3 From b42ccece49d88874b8221570f62c08366b9d5eab Mon Sep 17 00:00:00 2001 From: Nath Tumlin Date: Mon, 13 Mar 2017 19:15:41 -0500 Subject: Style changes --- Library/Homebrew/test/cask/cli/search_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/test/cask/cli') diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb index cc4e0ae63..cbd8ceb9d 100644 --- a/Library/Homebrew/test/cask/cli/search_spec.rb +++ b/Library/Homebrew/test/cask/cli/search_spec.rb @@ -58,14 +58,14 @@ describe Hbc::CLI::Search, :cask do end it "doesn't highlight not installed packages" do - expect(Hbc::CLI::Search.highlight_installed "local-caffeine").to eq("local-caffeine") + expect(Hbc::CLI::Search.highlight_installed("local-caffeine")).to eq("local-caffeine") end it "highlights installed packages" do shutup do - Hbc::CLI::Install.run("local-caffeine") + Hbc::CLI::Install.run("local-caffeine") end - expect(Hbc::CLI::Search.highlight_installed "local-caffeine").to eq(pretty_installed "local-caffeine") + expect(Hbc::CLI::Search.highlight_installed("local-caffeine")).to eq(pretty_installed("local-caffeine")) end end -- cgit v1.2.3 From 48e4463f5b458c731c6bbbaa200dd805bad32de0 Mon Sep 17 00:00:00 2001 From: Nath Tumlin Date: Mon, 13 Mar 2017 19:43:08 -0500 Subject: Fixed test case wording --- Library/Homebrew/test/cask/cli/search_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/test/cask/cli') diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb index cbd8ceb9d..9843a6de6 100644 --- a/Library/Homebrew/test/cask/cli/search_spec.rb +++ b/Library/Homebrew/test/cask/cli/search_spec.rb @@ -57,7 +57,7 @@ describe Hbc::CLI::Search, :cask do }.to output(/^No Cask found for "caskroom"\.\n/).to_stdout end - it "doesn't highlight not installed packages" do + it "doesn't highlight packages that aren't installed" do expect(Hbc::CLI::Search.highlight_installed("local-caffeine")).to eq("local-caffeine") end -- cgit v1.2.3