simctl 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dfe7554bf2998c41f884105ec70bc6a4dee155a
4
- data.tar.gz: b96a52ae6049709614ded55bc6038afc9ed23ed5
3
+ metadata.gz: b6319499832101d1764c51beca6deb17a733bb6e
4
+ data.tar.gz: 72e4cce1320238f838cf2402dfeda5982fc23045
5
5
  SHA512:
6
- metadata.gz: 8864a6e8fc2d0d5106bd9c1baad25225a8f6ce3bd9141ab2226d0b809d2ba5648c155da99681d4de21fcfa01c851710d72118715534198125d861a635fa810cb
7
- data.tar.gz: b4541558026993c78934f76ae571648a21f210c7537595070fb5bec80f3961e99d68095e37c7b66ff49e131868e5e5505d3e601e46759b49a08f60cb47bc12f4
6
+ metadata.gz: e5f94ba9adb2fd3b3973bce68c70a458e04493dfdf7d7f4e5ff2c997adfe18360100b500b3253a1edd7c90cfa437ae2bc13c4baefd6afefb228b07ba256f9e36
7
+ data.tar.gz: 865de7a145b2fa34f2aa1e59d5e211bbc7d30f790fd2b8b6ae3fed15e44b0c60b62006d3261b2fa6b2f35f3c787a5fcdd9acde3e61761a01e90d9e140cbc932b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simctl (1.3.0)
4
+ simctl (1.3.1)
5
5
  CFPropertyList
6
6
 
7
7
  GEM
data/lib/simctl/device.rb CHANGED
@@ -8,18 +8,30 @@ module SimCtl
8
8
  class Device < Object
9
9
  attr_reader :availability, :name, :os, :state, :udid
10
10
 
11
+ # Boots the device
12
+ #
13
+ # @return [void]
11
14
  def boot!
12
15
  SimCtl.boot_device(self)
13
16
  end
14
17
 
18
+ # Deletes the device
19
+ #
20
+ # @return [void]
15
21
  def delete!
16
22
  SimCtl.delete_device(self)
17
23
  end
18
24
 
25
+ # Returns the device type
26
+ #
27
+ # @return [SimCtl::DeviceType]
19
28
  def devicetype
20
29
  @devicetype ||= SimCtl.devicetype(identifier: plist.deviceType)
21
30
  end
22
31
 
32
+ # Disables the keyboard helpers
33
+ #
34
+ # @return [void]
23
35
  def disable_keyboard_helpers!
24
36
  path.edit path.preferences_plist do |plist|
25
37
  %w(
@@ -38,14 +50,23 @@ module SimCtl
38
50
  end
39
51
  end
40
52
 
53
+ # Erases the device
54
+ #
55
+ # @return [void]
41
56
  def erase!
42
57
  SimCtl.erase_device(self)
43
58
  end
44
59
 
60
+ # Kills the device
61
+ #
62
+ # @return [void]
45
63
  def kill!
46
64
  SimCtl.kill_device(self)
47
65
  end
48
66
 
67
+ # Launches the Simulator
68
+ #
69
+ # @return [void]
49
70
  def launch!(scale=1.0, opts={})
50
71
  SimCtl.launch_device(self, scale, opts)
51
72
  end
@@ -54,26 +75,44 @@ module SimCtl
54
75
  @path ||= DevicePath.new(udid)
55
76
  end
56
77
 
78
+ # Renames the device
79
+ #
80
+ # @return [void]
57
81
  def rename!(name)
58
82
  SimCtl.rename_device(self, name)
59
83
  end
60
84
 
85
+ # Resets the device
86
+ #
87
+ # @return [void]
61
88
  def reset!
62
89
  SimCtl.reset_device name, devicetype, runtime
63
90
  end
64
91
 
92
+ # Resets the runtime
93
+ #
94
+ # @return [SimCtl::Runtime]
65
95
  def runtime
66
96
  @runtime ||= SimCtl.runtime(identifier: plist.runtime)
67
97
  end
68
98
 
99
+ # Shuts down the runtime
100
+ #
101
+ # @return [void]
69
102
  def shutdown!
70
103
  SimCtl.shutdown_device(self)
71
104
  end
72
105
 
106
+ # Returns the state of the device
107
+ #
108
+ # @return [sym]
73
109
  def state
74
110
  @state.downcase.to_sym
75
111
  end
76
112
 
113
+ # Reloads the device until the given block returns true
114
+ #
115
+ # @return [void]
77
116
  def wait!(timeout=15)
78
117
  Timeout::timeout(timeout) do
79
118
  loop do
@@ -1,3 +1,3 @@
1
1
  module SimCtl
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -34,6 +34,7 @@ class SimCtl::Command::CRUDTest < Minitest::Test
34
34
 
35
35
  should '03. find the device by name' do
36
36
  assert SimCtl.device(name: name).udid == udid
37
+ assert SimCtl.device(name: name) == SimCtl.device(udid: udid)
37
38
  end
38
39
 
39
40
  should '04. have devicetype property' do
@@ -77,9 +78,15 @@ class SimCtl::Command::CRUDTest < Minitest::Test
77
78
  device.wait!{|d| d.state == :shutdown}
78
79
  end
79
80
 
80
- should '12. reset the device' do
81
+ should '12. disable keyboard helpers' do
82
+ device = SimCtl.device(udid: udid)
83
+ device.disable_keyboard_helpers!
84
+ assert File.exists?(device.path.preferences_plist)
85
+ end
86
+
87
+ should '98. reset the device' do
81
88
  old_device = SimCtl.device(udid: udid)
82
- new_device = SimCtl.reset_device old_device.name, old_device.devicetype, old_device.runtime
89
+ new_device = old_device.reset!
83
90
  new_device.wait!{|d| d.state != :creating}
84
91
  assert old_device.name == new_device.name
85
92
  assert old_device.devicetype == new_device.devicetype
@@ -88,7 +95,7 @@ class SimCtl::Command::CRUDTest < Minitest::Test
88
95
  udid = new_device.udid
89
96
  end
90
97
 
91
- should '13. delete the device' do
98
+ should '99. delete the device' do
92
99
  device = SimCtl.device(udid: udid)
93
100
  device.delete!
94
101
  assert_nil SimCtl.device(udid: udid)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Plunien
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake