Skip to content

Commit

Permalink
correct push pull operations for multiple arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbyler committed Sep 19, 2012
1 parent bfa1001 commit 87ec09c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
=== Release 0.5.4 / 2012-9-19
* Fixes
* Corrected push, pull when multiple arguments used

=== Release 0.5.3 / 2012-9-18
* Enhancements
* Added travis-ci config file for automated specs
Expand Down
2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

at_exit do
# emulator.stop
File.delete('cuke_test_file.txt') unless not File.exists?('cuke_test_file.txt')
end


After do
stop_server
sleep 1
Expand Down
6 changes: 4 additions & 2 deletions lib/ADB.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def forward(source, destination, target={}, timeout=30)
# seconds.
#
def push(source, destination, target={}, timeout=30)
execute_adb_with_exactly(timeout, "#{which_one(target)} push".split, source, destination)
args = "#{which_one(target)} push".split
execute_adb_with_exactly(timeout, *args, source, destination)
end

#
Expand All @@ -173,7 +174,8 @@ def push(source, destination, target={}, timeout=30)
# seconds.
#
def pull(source, destination, target={}, timeout=30)
execute_adb_with_exactly(timeout, "#{which_one(target)} pull".split, source, destination)
args = "#{which_one(target)} pull".split
execute_adb_with_exactly(timeout, *args, source, destination)
end

#
Expand Down
2 changes: 1 addition & 1 deletion lib/ADB/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ADB
VERSION = "0.5.3"
VERSION = "0.5.4"
end
8 changes: 4 additions & 4 deletions spec/lib/ADB_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@
context "when transferring files" do

it "should be able to push a file" do
should_call_adb_with(' push', '/usr/foo.txt', '/sdcard/bar.txt')
should_call_adb_with('push', '/usr/foo.txt', '/sdcard/bar.txt')
ADB.push('/usr/foo.txt', '/sdcard/bar.txt')
end

it "should be able to push a file with spaces in the name" do
should_call_adb_with(' push', '/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
should_call_adb_with('push', '/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
ADB.push('/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
end

it "should be able to pull a file" do
should_call_adb_with(' pull', '/usr/foo.txt', '/sdcard/bar.txt')
should_call_adb_with('pull', '/usr/foo.txt', '/sdcard/bar.txt')
ADB.pull('/usr/foo.txt', '/sdcard/bar.txt')
end

it "should be able to pull a file with spaces in the name" do
should_call_adb_with(' pull', '/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
should_call_adb_with('pull', '/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
ADB.pull('/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
end

Expand Down

0 comments on commit 87ec09c

Please sign in to comment.