aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-23 06:00:54 +0100
committerMarkus Reiter2017-02-23 21:34:50 +0100
commitbdbb74816902e8318f0d5231d9fb81234d361e90 (patch)
treed41b75037ed60bf5aed44ccad4403de0833b5fa7 /Library/Homebrew/test
parentc7121f6be50e44784e3e29114617c29715bd9c0f (diff)
downloadbrew-bdbb74816902e8318f0d5231d9fb81234d361e90.tar.bz2
Convert `brew edit` test to spec.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/dev-cmd/edit_spec.rb16
-rw-r--r--Library/Homebrew/test/edit_test.rb11
2 files changed, 16 insertions, 11 deletions
diff --git a/Library/Homebrew/test/dev-cmd/edit_spec.rb b/Library/Homebrew/test/dev-cmd/edit_spec.rb
new file mode 100644
index 000000000..5cedb0524
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/edit_spec.rb
@@ -0,0 +1,16 @@
+describe "brew edit", :integration_test do
+ it "opens a given Formula in an editor" do
+ HOMEBREW_REPOSITORY.cd do
+ shutup do
+ system "git", "init"
+ end
+ end
+
+ setup_test_formula "testball"
+
+ expect { brew "edit", "testball", "HOMEBREW_EDITOR" => "/bin/cat" }
+ .to output(/# something here/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/edit_test.rb b/Library/Homebrew/test/edit_test.rb
deleted file mode 100644
index 9b6ded651..000000000
--- a/Library/Homebrew/test/edit_test.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestEdit < IntegrationCommandTestCase
- def test_edit
- (HOMEBREW_REPOSITORY/".git").mkpath
- setup_test_formula "testball"
-
- assert_match "# something here",
- cmd("edit", "testball", "HOMEBREW_EDITOR" => "/bin/cat")
- end
-end