diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-03 21:09:07 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-03 21:09:07 +0300 |
commit | e91ff84df72a76b91bb8c24a6e677cdca98120de (patch) | |
tree | 71997153a4063f957da502bc87dc4e962bd2f960 /spec/lib/gitlab/popen_spec.rb | |
parent | 3011ac4150e355da9e5956cb223d19e18425e0eb (diff) | |
download | gitlab-ce-e91ff84df72a76b91bb8c24a6e677cdca98120de.tar.gz |
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.rb | 29 |
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 + |