spec/lib/ADB_spec.rb in ADB-0.1 vs spec/lib/ADB_spec.rb in ADB-0.2

- old
+ new

@@ -27,9 +27,26 @@ ADB.should_receive(:last_stdout).and_return("device") should_call_adb_with('devices') ADB.devices end + context "when executing a shell command" do + it "should be able to check the device date and time" do + should_call_adb_with('wait-for-device', 'shell', 'date') + ADB.shell('date') + end + end + + it "should be able to build an date formatted for adb shell date command" do + date = DateTime.strptime('04/23/2012 13:24', '%m/%d/%C%y %H:%M') + ADB.format_date_for_adb(date).should eq "20120423.132400" + end + + it "should setup port forwarding" do + should_call_adb_with('forward', 'src', 'dest') + ADB.forward('src', 'dest') + end + context "when connecting to a device" do before(:each) do ADB.should_receive(:last_stdout).and_return("connected to localhost") end