Permalink
Browse files

Don't print output messages in copy function [#6]

  • Loading branch information...
1 parent bee7807 commit 9993c92a7f27a85ac3b20a933afe44ae7c093947 @oscardelben committed Apr 18, 2012
Showing with 2 additions and 4 deletions.
  1. +1 −2 lib/sheet/copy.rb
  2. +1 −2 spec/sheet/copy_spec.rb
View
@@ -28,8 +28,7 @@ def check_if_sheet_exists_and_copy_sheet
def copy_sheet
copy_cmd = Sheet.copy_command
if copy_cmd
- Sheet.exec("cat #{Sheet::sheet_path(name)} | #{copy_cmd}")
- Sheet.write("Copied!")
+ Sheet.exec("cat #{Sheet::sheet_path(name)} | #{copy_cmd}", true)
else
Sheet.write("Could not copy sheet, no copy command found")
end
@@ -4,8 +4,7 @@
it 'should copy the snippet' do
cmd = "cat #{Sheet.sheet_path('git')} | pbcopy"
- Sheet.should_receive(:exec).with(cmd)
- Sheet.should_receive(:write).with("Copied!")
+ Sheet.should_receive(:exec).with(cmd, true)
Sheet.stub(:copy_command) { 'pbcopy' }
Sheet.stub(:sheet_exists?).with('git') { true }

0 comments on commit 9993c92

Please sign in to comment.