Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-03 22:09:07 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-03 22:09:07 +0400
commite91ff84df72a76b91bb8c24a6e677cdca98120de (patch)
tree71997153a4063f957da502bc87dc4e962bd2f960 /spec/lib/gitlab/popen_spec.rb
parent3011ac4150e355da9e5956cb223d19e18425e0eb (diff)
keep same dir structure for specs as in lib/
Diffstat (limited to 'spec/lib/gitlab/popen_spec.rb')
-rw-r--r--spec/lib/gitlab/popen_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/popen_spec.rb b/spec/lib/gitlab/popen_spec.rb
new file mode 100644
index 00000000000..4791be41613
--- /dev/null
+++ b/spec/lib/gitlab/popen_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe 'Gitlab::Popen', no_db: true do
+ let (:path) { Rails.root.join('tmp').to_s }
+
+ before do
+ @klass = Class.new(Object)
+ @klass.send(:include, Gitlab::Popen)
+ end
+
+ context 'zero status' do
+ before do
+ @output, @status = @klass.new.popen('ls', path)
+ end
+
+ it { @status.should be_zero }
+ it { @output.should include('cache') }
+ end
+
+ context 'non-zero status' do
+ before do
+ @output, @status = @klass.new.popen('cat NOTHING', path)
+ end
+
+ it { @status.should == 1 }
+ it { @output.should include('No such file or directory') }
+ end
+end
+