aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-25 04:54:37 +0100
committerGitHub2017-02-25 04:54:37 +0100
commitb488a89b5d2bd9c96e3128f598221fed1c3c1911 (patch)
tree88ee9dd66b51b902e70de5b118c11200f6dcda68 /Library/Homebrew/test
parent231eefa98cff3540cecd2f05b68277b3b5aebd79 (diff)
parent9d512be63ca1ab039e8e46ba44efa6454008bb7e (diff)
downloadbrew-b488a89b5d2bd9c96e3128f598221fed1c3c1911.tar.bz2
Merge pull request #2138 from reitermarkus/spec-irb
Convert `brew irb` test to spec.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/cmd/irb_spec.rb24
-rw-r--r--Library/Homebrew/test/irb_test.rb19
2 files changed, 24 insertions, 19 deletions
diff --git a/Library/Homebrew/test/cmd/irb_spec.rb b/Library/Homebrew/test/cmd/irb_spec.rb
new file mode 100644
index 000000000..44410fabe
--- /dev/null
+++ b/Library/Homebrew/test/cmd/irb_spec.rb
@@ -0,0 +1,24 @@
+describe "brew irb", :integration_test do
+ it "starts an interactive Homebrew shell session" do
+ setup_test_formula "testball"
+
+ irb_test = HOMEBREW_TEMP/"irb-test.rb"
+ irb_test.write <<-EOS.undent
+ "testball".f
+ :testball.f
+ exit
+ EOS
+
+ expect { brew "irb", irb_test }
+ .to output(/Interactive Homebrew Shell/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ specify "--examples" do
+ expect { brew "irb", "--examples" }
+ .to output(/'v8'\.f # => instance of the v8 formula/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/irb_test.rb b/Library/Homebrew/test/irb_test.rb
deleted file mode 100644
index 832ca39a5..000000000
--- a/Library/Homebrew/test/irb_test.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestIrb < IntegrationCommandTestCase
- def test_irb
- assert_match "'v8'.f # => instance of the v8 formula",
- cmd("irb", "--examples")
-
- setup_test_formula "testball"
-
- irb_test = HOMEBREW_TEMP/"irb-test.rb"
- irb_test.write <<-EOS.undent
- "testball".f
- :testball.f
- exit
- EOS
-
- assert_match "Interactive Homebrew Shell", cmd("irb", irb_test)
- end
-end