simctl 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/lib/simctl.rb +10 -0
- data/lib/simctl/command/create.rb +3 -1
- data/lib/simctl/device.rb +1 -1
- data/lib/simctl/version.rb +1 -1
- data/test/simctl/command/crud_test.rb +0 -2
- data/test/simctl/command/readme_test.rb +30 -0
- data/test/test_helper.rb +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da76a9f1cad014fffee2818138f5e11fbd0cc97e
|
4
|
+
data.tar.gz: 3932e4c59a417d56f38a69af7f0dd5c16bc12e15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee307c69171853a9d164756c7d842169e33df54a017264bbbc2c9a17fb7c4a5a372d86d9922b989e4333c30224906dbc9050edcce11a04f9a3aad83e5c713a7b
|
7
|
+
data.tar.gz: 5abd74d5dd1214848a0c0023774c3fa434897d3c3b80660a60876848b39644749ca7b00052f3ad29558af8b7d2bda12bbf1b405c2427deb5f82a95a2ebaa821b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/simctl.rb
CHANGED
@@ -5,7 +5,17 @@ require 'simctl/list'
|
|
5
5
|
require 'simctl/runtime'
|
6
6
|
|
7
7
|
module SimCtl
|
8
|
+
@@default_timeout = 15
|
9
|
+
|
8
10
|
class << self
|
11
|
+
def default_timeout
|
12
|
+
@@default_timeout
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_timeout=(timeout)
|
16
|
+
@@default_timeout = timeout
|
17
|
+
end
|
18
|
+
|
9
19
|
def command
|
10
20
|
return @command if defined?(@command)
|
11
21
|
@command = SimCtl::Command.new
|
@@ -16,9 +16,11 @@ module SimCtl
|
|
16
16
|
devicetype = devicetype(name: devicetype) unless devicetype.is_a?(DeviceType)
|
17
17
|
raise "Invalid runtime: #{runtime}" unless runtime.is_a?(Runtime)
|
18
18
|
raise "Invalid devicetype: #{devicetype}" unless devicetype.is_a?(DeviceType)
|
19
|
-
Executor.execute([COMMAND, Shellwords.shellescape(name), devicetype.identifier, runtime.identifier]) do |identifier|
|
19
|
+
device = Executor.execute([COMMAND, Shellwords.shellescape(name), devicetype.identifier, runtime.identifier]) do |identifier|
|
20
20
|
device(udid: identifier)
|
21
21
|
end
|
22
|
+
device.wait! {|d| d.state == :shutdown && File.exists?(d.path.device_plist)}
|
23
|
+
device
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
data/lib/simctl/device.rb
CHANGED
@@ -126,7 +126,7 @@ module SimCtl
|
|
126
126
|
# Reloads the device until the given block returns true
|
127
127
|
#
|
128
128
|
# @return [void]
|
129
|
-
def wait!(timeout=
|
129
|
+
def wait!(timeout=SimCtl.default_timeout)
|
130
130
|
Timeout::timeout(timeout) do
|
131
131
|
loop do
|
132
132
|
break if yield SimCtl.device(udid: udid)
|
data/lib/simctl/version.rb
CHANGED
@@ -104,8 +104,6 @@ class SimCtl::Command::CRUDTest < Minitest::Test
|
|
104
104
|
should '9800. reset the device' do
|
105
105
|
old_device = SimCtl.device(udid: udid)
|
106
106
|
new_device = old_device.reset!
|
107
|
-
new_device.wait!{|d| d.state != :creating}
|
108
|
-
new_device.wait!{|d| File.exists?(d.path.device_plist)}
|
109
107
|
assert old_device.name == new_device.name
|
110
108
|
assert old_device.devicetype == new_device.devicetype
|
111
109
|
assert old_device.runtime == new_device.runtime
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SimCtl::Command::ReadmeTest < Minitest::Test
|
4
|
+
should 'execute example code from readme' do
|
5
|
+
# Select the iOS 9.2 runtime
|
6
|
+
runtime = SimCtl.runtime(name: 'iOS 9.2')
|
7
|
+
|
8
|
+
# Select the iPhone 5 device type
|
9
|
+
devicetype = SimCtl.devicetype(name: 'iPhone 5')
|
10
|
+
|
11
|
+
# Create a new device
|
12
|
+
device = SimCtl.create_device 'Unit Tests @ iPhone 5 9.2', devicetype, runtime
|
13
|
+
|
14
|
+
# Launch a new Simulator.app instance
|
15
|
+
device.launch!
|
16
|
+
|
17
|
+
# Wait for the device to be booted
|
18
|
+
device.wait! {|d| d.state == :booted}
|
19
|
+
|
20
|
+
# Kill the Simulator.app instance again
|
21
|
+
device.shutdown!
|
22
|
+
device.kill!
|
23
|
+
|
24
|
+
# Wait until it did shutdown
|
25
|
+
device.wait! {|d| d.state == :shutdown}
|
26
|
+
|
27
|
+
# Delete the device
|
28
|
+
device.delete!
|
29
|
+
end
|
30
|
+
end
|
data/test/test_helper.rb
CHANGED
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.5.
|
4
|
+
version: 1.5.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-
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- test/SampleApp/SampleApp/main.m
|
129
129
|
- test/simctl/command/crud_test.rb
|
130
130
|
- test/simctl/command/list_test.rb
|
131
|
+
- test/simctl/command/readme_test.rb
|
131
132
|
- test/test_helper.rb
|
132
133
|
homepage: https://github.com/plu/simctl
|
133
134
|
licenses:
|
@@ -163,4 +164,5 @@ test_files:
|
|
163
164
|
- test/SampleApp/SampleApp/main.m
|
164
165
|
- test/simctl/command/crud_test.rb
|
165
166
|
- test/simctl/command/list_test.rb
|
167
|
+
- test/simctl/command/readme_test.rb
|
166
168
|
- test/test_helper.rb
|