honeydew 0.1.4 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/README.md +4 -1
  2. data/Rakefile +2 -2
  3. data/example/Gemfile +3 -3
  4. data/honeydew.gemspec +7 -6
  5. data/lib/honeydew.rb +2 -2
  6. data/lib/honeydew/device.rb +3 -12
  7. data/lib/honeydew/device_actions.rb +61 -62
  8. data/lib/honeydew/device_commands.rb +3 -3
  9. data/lib/honeydew/device_matchers.rb +36 -14
  10. data/lib/honeydew/version.rb +1 -1
  11. data/{android-server → server}/.gitignore +0 -0
  12. data/{android-server → server}/pom.xml +5 -5
  13. data/{android-server → server}/repo/com/google/android/uiautomator/4.1.1.4/_maven.repositories +0 -0
  14. data/{android-server → server}/repo/com/google/android/uiautomator/4.1.1.4/uiautomator-4.1.1.4.jar +0 -0
  15. data/{android-server → server}/repo/com/google/android/uiautomator/4.1.1.4/uiautomator-4.1.1.4.pom +0 -0
  16. data/{android-server → server}/repo/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.5.2-SNAPSHOT/android-maven-plugin-3.5.2-SNAPSHOT.jar +0 -0
  17. data/{android-server → server}/repo/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.5.2-SNAPSHOT/android-maven-plugin-3.5.2-SNAPSHOT.pom +0 -0
  18. data/{android-server → server}/repo/com/jayway/maven/plugins/android/generation2/android-maven-plugin/3.5.2-SNAPSHOT/maven-metadata-local.xml +0 -0
  19. data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/_maven.repositories +0 -0
  20. data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/commons-jxpath-1.4-SNAPSHOT.jar +0 -0
  21. data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/commons-jxpath-1.4-SNAPSHOT.pom +0 -0
  22. data/{android-server → server}/repo/commons-jxpath/commons-jxpath/1.4-SNAPSHOT/maven-metadata-local.xml +0 -0
  23. data/{android-server → server}/repo/commons-jxpath/commons-jxpath/maven-metadata-local.xml +0 -0
  24. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/Action.java +1 -1
  25. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/ActionsExecutor.java +2 -2
  26. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/Command.java +1 -1
  27. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/Result.java +1 -1
  28. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/TestRunner.java +3 -3
  29. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/Click.java +3 -3
  30. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/ClickAndWaitForNewWindow.java +3 -3
  31. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/DumpWindowHierarchy.java +3 -3
  32. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/HasSettingsMenuItem.java +4 -4
  33. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/InspectOptionInSettingsMenu.java +2 -2
  34. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/IsButtonPresent.java +3 -3
  35. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/IsChildCountEqualTo.java +3 -3
  36. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/IsElementWithNestedTextPresent.java +3 -3
  37. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/IsOptionInSettingsMenuDisabled.java +1 -1
  38. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/IsOptionInSettingsMenuEnabled.java +1 -1
  39. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/IsTextPresent.java +3 -3
  40. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/LaunchApp.java +3 -3
  41. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/LaunchHome.java +3 -3
  42. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/LongClick.java +3 -3
  43. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/PressBack.java +3 -3
  44. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/PressEnter.java +4 -4
  45. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/SelectFromAppsList.java +3 -3
  46. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/SelectMenuInSettings.java +3 -3
  47. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/SetText.java +3 -3
  48. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/SetTextByIndex.java +2 -2
  49. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/SetTextByLabel.java +3 -3
  50. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/Unlock.java +3 -3
  51. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/actions/WakeUp.java +4 -4
  52. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/httpd/NanoHTTPD.java +2 -2
  53. data/{android-server/src/main/java/com/uiautomator_cucumber/android_server → server/src/main/java/com/amplify/honeydew}/httpd/RemoteCommandReceiver.java +5 -5
  54. data/spec/honeydew/device_matchers_spec.rb +21 -42
  55. data/spec/honeydew/device_spec.rb +37 -35
  56. metadata +57 -68
  57. data/lib/honeydew/hooks.rb +0 -0
  58. data/lib/honeydew/step_definitions.rb +0 -75
  59. data/lib/tasks/honeydew.rake +0 -7
@@ -1,4 +1,4 @@
1
- package com.uiautomator_cucumber.android_server;
1
+ package com.amplify.honeydew;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObject;
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server;
1
+ package com.amplify.honeydew;
2
2
 
3
3
  import android.util.Log;
4
4
  import com.android.uiautomator.core.UiDevice;
5
- import com.uiautomator_cucumber.android_server.actions.*;
5
+ import com.amplify.honeydew.actions.*;
6
6
 
7
7
  import java.lang.reflect.Constructor;
8
8
  import java.lang.reflect.InvocationTargetException;
@@ -1,4 +1,4 @@
1
- package com.uiautomator_cucumber.android_server;
1
+ package com.amplify.honeydew;
2
2
 
3
3
  import java.util.Map;
4
4
 
@@ -1,4 +1,4 @@
1
- package com.uiautomator_cucumber.android_server;
1
+ package com.amplify.honeydew;
2
2
 
3
3
  import org.apache.commons.lang.exception.ExceptionUtils;
4
4
 
@@ -1,9 +1,9 @@
1
- package com.uiautomator_cucumber.android_server;
1
+ package com.amplify.honeydew;
2
2
 
3
3
  import android.view.KeyEvent;
4
4
  import com.android.uiautomator.core.UiDevice;
5
5
  import com.android.uiautomator.testrunner.UiAutomatorTestCase;
6
- import com.uiautomator_cucumber.android_server.httpd.RemoteCommandReceiver;
6
+ import com.amplify.honeydew.httpd.RemoteCommandReceiver;
7
7
 
8
8
  public class TestRunner extends UiAutomatorTestCase {
9
9
 
@@ -23,4 +23,4 @@ public class TestRunner extends UiAutomatorTestCase {
23
23
  getUiDevice().pressKeyCode(KeyEvent.KEYCODE_MENU);
24
24
  getUiDevice().pressKeyCode(KeyEvent.KEYCODE_MENU);
25
25
  }
26
- }
26
+ }
@@ -1,9 +1,9 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObjectNotFoundException;
5
- import com.uiautomator_cucumber.android_server.Action;
6
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.Action;
6
+ import com.amplify.honeydew.Result;
7
7
 
8
8
  import java.util.Map;
9
9
 
@@ -1,9 +1,9 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObjectNotFoundException;
5
- import com.uiautomator_cucumber.android_server.Action;
6
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.Action;
6
+ import com.amplify.honeydew.Result;
7
7
 
8
8
  import java.util.Map;
9
9
 
@@ -1,9 +1,9 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObjectNotFoundException;
5
- import com.uiautomator_cucumber.android_server.Action;
6
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.Action;
6
+ import com.amplify.honeydew.Result;
7
7
  import org.apache.commons.io.FileUtils;
8
8
 
9
9
  import java.io.File;
@@ -1,9 +1,9 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import android.widget.TextView;
4
4
  import com.android.uiautomator.core.*;
5
- import com.uiautomator_cucumber.android_server.Action;
6
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.Action;
6
+ import com.amplify.honeydew.Result;
7
7
 
8
8
  import java.util.List;
9
9
  import java.util.Map;
@@ -20,4 +20,4 @@ public class HasSettingsMenuItem extends Action {
20
20
  UiObject menuItem = settingsMenu.getChildByText(new UiSelector().className(TextView.class.getName()), menuName);
21
21
  return menuItem.exists() ? Result.OK : Result.FAILURE;
22
22
  }
23
- }
23
+ }
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import android.widget.TextView;
4
4
  import com.android.uiautomator.core.*;
5
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.List;
8
8
  import java.util.Map;
@@ -1,11 +1,11 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObject;
5
5
  import com.android.uiautomator.core.UiObjectNotFoundException;
6
6
  import com.android.uiautomator.core.UiSelector;
7
- import com.uiautomator_cucumber.android_server.Action;
8
- import com.uiautomator_cucumber.android_server.Result;
7
+ import com.amplify.honeydew.Action;
8
+ import com.amplify.honeydew.Result;
9
9
 
10
10
  import java.util.Map;
11
11
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -1,4 +1,4 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
 
@@ -1,4 +1,4 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
 
@@ -1,9 +1,9 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObjectNotFoundException;
5
- import com.uiautomator_cucumber.android_server.Action;
6
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.Action;
6
+ import com.amplify.honeydew.Result;
7
7
 
8
8
  import java.util.Map;
9
9
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -1,9 +1,9 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObjectNotFoundException;
5
- import com.uiautomator_cucumber.android_server.Action;
6
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.Action;
6
+ import com.amplify.honeydew.Result;
7
7
 
8
8
  import java.util.Map;
9
9
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -16,4 +16,4 @@ public class PressEnter extends Action {
16
16
  getUiDevice().pressEnter();
17
17
  return Result.OK;
18
18
  }
19
- }
19
+ }
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
 
7
7
  import java.util.Map;
8
8
 
@@ -1,11 +1,11 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObject;
5
5
  import com.android.uiautomator.core.UiObjectNotFoundException;
6
6
  import com.android.uiautomator.core.UiSelector;
7
- import com.uiautomator_cucumber.android_server.Action;
8
- import com.uiautomator_cucumber.android_server.Result;
7
+ import com.amplify.honeydew.Action;
8
+ import com.amplify.honeydew.Result;
9
9
 
10
10
  import java.util.Map;
11
11
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import android.util.*;
4
4
  import com.android.uiautomator.core.*;
5
- import com.uiautomator_cucumber.android_server.*;
5
+ import com.amplify.honeydew.*;
6
6
 
7
7
  import java.util.*;
8
8
 
@@ -1,11 +1,11 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObject;
5
5
  import com.android.uiautomator.core.UiObjectNotFoundException;
6
6
  import com.android.uiautomator.core.UiSelector;
7
- import com.uiautomator_cucumber.android_server.Action;
8
- import com.uiautomator_cucumber.android_server.Result;
7
+ import com.amplify.honeydew.Action;
8
+ import com.amplify.honeydew.Result;
9
9
 
10
10
  import java.util.Map;
11
11
 
@@ -1,11 +1,11 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.UiDevice;
4
4
  import com.android.uiautomator.core.UiObject;
5
5
  import com.android.uiautomator.core.UiObjectNotFoundException;
6
6
  import com.android.uiautomator.core.UiSelector;
7
- import com.uiautomator_cucumber.android_server.Action;
8
- import com.uiautomator_cucumber.android_server.Result;
7
+ import com.amplify.honeydew.Action;
8
+ import com.amplify.honeydew.Result;
9
9
 
10
10
  import java.util.Map;
11
11
 
@@ -1,8 +1,8 @@
1
- package com.uiautomator_cucumber.android_server.actions;
1
+ package com.amplify.honeydew.actions;
2
2
 
3
3
  import com.android.uiautomator.core.*;
4
- import com.uiautomator_cucumber.android_server.Action;
5
- import com.uiautomator_cucumber.android_server.Result;
4
+ import com.amplify.honeydew.Action;
5
+ import com.amplify.honeydew.Result;
6
6
  import android.os.RemoteException;
7
7
 
8
8
  import java.util.Map;
@@ -21,4 +21,4 @@ public class WakeUp extends Action {
21
21
  }
22
22
  return Result.OK;
23
23
  }
24
- }
24
+ }
@@ -1,4 +1,4 @@
1
- package com.uiautomator_cucumber.android_server.httpd;
1
+ package com.amplify.honeydew.httpd;
2
2
 
3
3
  import java.io.*;
4
4
  import java.net.ServerSocket;
@@ -1097,4 +1097,4 @@ public class NanoHTTPD
1097
1097
  "THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n"+
1098
1098
  "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"+
1099
1099
  "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
1100
- }
1100
+ }
@@ -1,10 +1,10 @@
1
- package com.uiautomator_cucumber.android_server.httpd;
1
+ package com.amplify.honeydew.httpd;
2
2
 
3
3
  import android.util.Log;
4
4
  import com.google.gson.Gson;
5
- import com.uiautomator_cucumber.android_server.ActionsExecutor;
6
- import com.uiautomator_cucumber.android_server.Command;
7
- import com.uiautomator_cucumber.android_server.Result;
5
+ import com.amplify.honeydew.ActionsExecutor;
6
+ import com.amplify.honeydew.Command;
7
+ import com.amplify.honeydew.Result;
8
8
 
9
9
  import java.io.File;
10
10
  import java.io.IOException;
@@ -61,4 +61,4 @@ public class RemoteCommandReceiver extends NanoHTTPD {
61
61
  private void log(String uri, String method, Properties params) {
62
62
  Log.d(TAG, String.format("Processing uri: %s, method: %s, params: %s", uri, method, params));
63
63
  }
64
- }
64
+ }
@@ -1,58 +1,37 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Honeydew::DeviceMatchers do
4
-
5
- class DeviceTest
6
- include Honeydew::DeviceMatchers
7
- def perform_action; end
4
+ let(:device) do
5
+ Class.new do
6
+ include Honeydew::DeviceMatchers
7
+ def perform_assertion; end
8
+ end.new
8
9
  end
9
10
 
10
- let (:device) { DeviceTest.new }
11
-
12
- describe "#has_textview_text" do
13
- let (:text) { "some text" }
14
-
15
- it "should perform action for is_text_present" do
16
- device.should_receive(:perform_action).with(hash_including({action: "is_text_present"}))
17
-
18
- device.has_textview_text? text
19
- end
20
-
21
- it "should retry for a default timeout" do
22
- device.should_receive(:perform_action).with(hash_including({retry_until: Honeydew.config.timeout}))
23
-
24
- device.has_textview_text? text
25
- end
11
+ describe '#has_textview_text' do
12
+ let(:text) { 'some text' }
26
13
 
27
- it "should pass the arguments for the text view" do
28
- device.should_receive(:perform_action).with(hash_including({arguments: { text: text, type: 'TextView'}}))
14
+ it 'should perform action for is_text_present' do
15
+ device.should_receive(:perform_assertion)
16
+ .with(:is_text_present,
17
+ hash_including(text: text, type: 'TextView'),
18
+ timeout: Honeydew.config.timeout)
29
19
 
30
20
  device.has_textview_text? text
31
21
  end
32
-
33
22
  end
34
23
 
35
- describe "#has_textview_with_text_and_description" do
36
- let (:text) { "some text" }
37
- let (:description) { "some description" }
38
-
39
- it "should perform action for is_text_present" do
40
- device.should_receive(:perform_action).with(hash_including({action: "is_text_present"}))
41
-
42
- device.has_textview_with_text_and_description? text, description
43
- end
44
-
45
- it "should retry for a default timeout" do
46
- device.should_receive(:perform_action).with(hash_including({retry_until: Honeydew.config.timeout}))
24
+ describe '#has_textview_with_text_and_description' do
25
+ let(:text) { 'some text' }
26
+ let(:description) { 'some description' }
47
27
 
48
- device.has_textview_with_text_and_description? text, description
49
- end
50
-
51
- it "should pass the arguments for the text view" do
52
- device.should_receive(:perform_action).with(hash_including({arguments: { text: text, description: description, type: 'TextView'}}))
28
+ it 'performs the is_text_present action' do
29
+ device.should_receive(:perform_assertion)
30
+ .with(:is_text_present,
31
+ hash_including(text: text, type: 'TextView'),
32
+ timeout: Honeydew.config.timeout)
53
33
 
54
34
  device.has_textview_with_text_and_description? text, description
55
35
  end
56
-
57
36
  end
58
- end
37
+ end