calabash-cucumber 0.11.4.pre2 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dylibs/libCalabashDyn.dylib +0 -0
- data/dylibs/libCalabashDynSim.dylib +0 -0
- data/lib/calabash-cucumber/utils/plist_buddy.rb +4 -136
- data/lib/calabash-cucumber/utils/xctools.rb +10 -1
- data/lib/calabash-cucumber/version.rb +2 -2
- data/staticlib/calabash.framework.zip +0 -0
- data/staticlib/libFrankCalabash.a +0 -0
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f35b46130d00873ebc65afa992b809afcac16f3
|
4
|
+
data.tar.gz: b529c844b3b234fa59cb7818c6deaf7b3e5c26f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98dfebb1d8c9ec4d812d3d46206c057a06c65e48ffeea5c7fa2807af26006fefcc611c6ce664aebaad0c7bacdbdd83567e4db99ef297e1f248a4157a9158baed
|
7
|
+
data.tar.gz: 010c95ce4ebc619e404fe9e50c5eb1cd759fcc40ae3b48149a76f2b4ca64f84aa6ff4969758f63c0d875c014163498b270912d1a9088bf15ea0e37beafd63b78
|
data/dylibs/libCalabashDyn.dylib
CHANGED
Binary file
|
Binary file
|
@@ -1,10 +1,7 @@
|
|
1
|
-
require '
|
1
|
+
require 'run_loop'
|
2
2
|
|
3
3
|
module Calabash
|
4
4
|
module Cucumber
|
5
|
-
|
6
|
-
include Calabash::Cucumber::Logging
|
7
|
-
|
8
5
|
# @!visibility private
|
9
6
|
# A module for reading and writing property list values.
|
10
7
|
module PlistBuddy
|
@@ -17,16 +14,7 @@ module Calabash
|
|
17
14
|
# @return [String] the value of the key
|
18
15
|
# @raise [ArgumentError] if nil or empty key
|
19
16
|
def plist_read(key, file, opts={})
|
20
|
-
|
21
|
-
raise(ArgumentError, "key '#{key}' must not be nil or empty")
|
22
|
-
end
|
23
|
-
cmd = build_plist_cmd(:print, {:key => key}, file)
|
24
|
-
res = execute_plist_cmd(cmd, opts)
|
25
|
-
if res == "Print: Entry, \":#{key}\", Does Not Exist"
|
26
|
-
nil
|
27
|
-
else
|
28
|
-
res
|
29
|
-
end
|
17
|
+
RunLoop::PlistBuddy.new.plist_read(key, file, opts)
|
30
18
|
end
|
31
19
|
|
32
20
|
# Checks if the key exists in plist.
|
@@ -50,128 +38,8 @@ module Calabash
|
|
50
38
|
# @return [Boolean] true if the operation was successful
|
51
39
|
# @raise [ArgumentError] if nil or empty key
|
52
40
|
def plist_set(key, type, value, file, opts={})
|
53
|
-
|
54
|
-
merged = default_opts.merge(opts)
|
55
|
-
|
56
|
-
if key.nil? or key.length == 0
|
57
|
-
raise(ArgumentError, "key '#{key}' must not be nil or empty")
|
58
|
-
end
|
59
|
-
|
60
|
-
cmd_args = {:key => key,
|
61
|
-
:type => type,
|
62
|
-
:value => value}
|
63
|
-
|
64
|
-
if plist_key_exists?(key, file, merged)
|
65
|
-
cmd = build_plist_cmd(:set, cmd_args, file)
|
66
|
-
else
|
67
|
-
cmd = build_plist_cmd(:add, cmd_args, file)
|
68
|
-
end
|
69
|
-
|
70
|
-
res = execute_plist_cmd(cmd, merged)
|
71
|
-
res == ''
|
72
|
-
end
|
73
|
-
|
74
|
-
private
|
75
|
-
|
76
|
-
# returns the path to the PlistBuddy executable
|
77
|
-
# @return [String] path to PlistBuddy
|
78
|
-
def plist_buddy
|
79
|
-
'/usr/libexec/PlistBuddy'
|
41
|
+
RunLoop::PlistBuddy.new.plist_set(key, type, value, file, opts)
|
80
42
|
end
|
81
|
-
|
82
|
-
# Executes cmd as a shell command and returns the result.
|
83
|
-
#
|
84
|
-
# @param [String] cmd shell command to execute
|
85
|
-
# @param [Hash] opts options for controlling execution
|
86
|
-
# @option opts [Boolean] :verbose (false) controls log level
|
87
|
-
# @return [Boolean] if command was successful
|
88
|
-
# @return [String] if :print'ing result, the value of the key - if there
|
89
|
-
# is an error, the output from stderr
|
90
|
-
def execute_plist_cmd(cmd, opts={})
|
91
|
-
default_opts = {:verbose => false}
|
92
|
-
merged = default_opts.merge(opts)
|
93
|
-
|
94
|
-
calabash_info(cmd) if merged[:verbose]
|
95
|
-
|
96
|
-
res = nil
|
97
|
-
# noinspection RubyUnusedLocalVariable
|
98
|
-
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
|
99
|
-
err = stderr.read
|
100
|
-
std = stdout.read
|
101
|
-
if not err.nil? and err != ''
|
102
|
-
res = err.chomp
|
103
|
-
else
|
104
|
-
res = std.chomp
|
105
|
-
end
|
106
|
-
end
|
107
|
-
res
|
108
|
-
end
|
109
|
-
|
110
|
-
# Composes a PlistBuddy command that can be executed as a shell command.
|
111
|
-
#
|
112
|
-
# @param [Symbol] type should be one of [:print, :set, :add]
|
113
|
-
#
|
114
|
-
# @param [Hash] args_hash arguments used to construct plist command
|
115
|
-
# @option args_hash [String] :key (required) the plist key
|
116
|
-
# @option args_hash [String] :value (required for :set and :add) the new value
|
117
|
-
# @option args_hash [String] :type (required for :add) the new type of the value
|
118
|
-
#
|
119
|
-
# @param [String] file the plist file to interact with (must exist)
|
120
|
-
#
|
121
|
-
# @raise [RuntimeError] if file does not exist
|
122
|
-
# @raise [ArgumentError] when invalid type is passed
|
123
|
-
# @raise [ArgumentError] when args_hash does not include required key/value pairs
|
124
|
-
#
|
125
|
-
# @return [String] a shell-ready PlistBuddy command
|
126
|
-
def build_plist_cmd(type, args_hash, file)
|
127
|
-
|
128
|
-
unless File.exist?(File.expand_path(file))
|
129
|
-
raise(RuntimeError, "plist '#{file}' does not exist - could not read")
|
130
|
-
end
|
131
|
-
|
132
|
-
case type
|
133
|
-
when :add
|
134
|
-
value_type = args_hash[:type]
|
135
|
-
unless value_type
|
136
|
-
raise(ArgumentError, ':value_type is a required key for :add command')
|
137
|
-
end
|
138
|
-
allowed_value_types = ['string', 'bool', 'real', 'integer']
|
139
|
-
unless allowed_value_types.include?(value_type)
|
140
|
-
raise(ArgumentError, "expected '#{value_type}' to be one of '#{allowed_value_types}'")
|
141
|
-
end
|
142
|
-
value = args_hash[:value]
|
143
|
-
unless value
|
144
|
-
raise(ArgumentError, ':value is a required key for :add command')
|
145
|
-
end
|
146
|
-
key = args_hash[:key]
|
147
|
-
unless key
|
148
|
-
raise(ArgumentError, ':key is a required key for :add command')
|
149
|
-
end
|
150
|
-
cmd_part = "\"Add :#{key} #{value_type} #{value}\""
|
151
|
-
when :print
|
152
|
-
key = args_hash[:key]
|
153
|
-
unless key
|
154
|
-
raise(ArgumentError, ':key is a required key for :print command')
|
155
|
-
end
|
156
|
-
cmd_part = "\"Print :#{key}\""
|
157
|
-
when :set
|
158
|
-
value = args_hash[:value]
|
159
|
-
unless value
|
160
|
-
raise(ArgumentError, ':value is a required key for :set command')
|
161
|
-
end
|
162
|
-
key = args_hash[:key]
|
163
|
-
unless key
|
164
|
-
raise(ArgumentError, ':key is a required key for :set command')
|
165
|
-
end
|
166
|
-
cmd_part = "\"Set :#{key} #{value}\""
|
167
|
-
else
|
168
|
-
cmds = [:add, :print, :set]
|
169
|
-
raise(ArgumentError, "expected '#{type}' to be one of '#{cmds}'")
|
170
|
-
end
|
171
|
-
|
172
|
-
"#{plist_buddy} -c #{cmd_part} \"#{file}\""
|
173
|
-
end
|
174
|
-
|
175
43
|
end
|
176
44
|
end
|
177
|
-
end
|
45
|
+
end
|
@@ -1,13 +1,14 @@
|
|
1
|
-
require 'open3'
|
2
1
|
require 'run_loop'
|
3
2
|
|
4
3
|
module Calabash
|
5
4
|
module Cucumber
|
6
5
|
|
6
|
+
# @deprecated 0.11.4 Replaced with RunLoop::XCTools.
|
7
7
|
# @!visibility private
|
8
8
|
# Methods for interacting with the xcode tools.
|
9
9
|
module XcodeTools
|
10
10
|
|
11
|
+
# @deprecated 0.11.4 Replaced with RunLoop::XCTools.
|
11
12
|
# Returns the path to the current developer directory.
|
12
13
|
#
|
13
14
|
# From the man pages:
|
@@ -22,6 +23,7 @@ module Calabash
|
|
22
23
|
#
|
23
24
|
# @return [String] path to current developer directory
|
24
25
|
def xcode_developer_dir
|
26
|
+
_deprecated('0.11.4', 'Use RunLoop::XCTools', :warn)
|
25
27
|
RunLoop::XCTools.new.xcode_developer_dir
|
26
28
|
end
|
27
29
|
|
@@ -33,6 +35,7 @@ module Calabash
|
|
33
35
|
File.expand_path("#{xcode_developer_dir}/usr/bin")
|
34
36
|
end
|
35
37
|
|
38
|
+
# @deprecated 0.11.4 Replaced with RunLoop::XCTools.
|
36
39
|
# Method for interacting with instruments.
|
37
40
|
#
|
38
41
|
# @example Getting the path to instruments.
|
@@ -54,8 +57,10 @@ module Calabash
|
|
54
57
|
return instruments if cmd == nil
|
55
58
|
case cmd
|
56
59
|
when :version
|
60
|
+
_deprecated('0.11.4', 'Use RunLoop::XCTools', :warn)
|
57
61
|
RunLoop::XCTools.new.instruments(cmd).to_s
|
58
62
|
when :sims
|
63
|
+
_deprecated('0.11.4', 'Use RunLoop::XCTools', :warn)
|
59
64
|
RunLoop::XCTools.new.instruments(cmd)
|
60
65
|
else
|
61
66
|
candidates = [:version, :sims]
|
@@ -63,6 +68,7 @@ module Calabash
|
|
63
68
|
end
|
64
69
|
end
|
65
70
|
|
71
|
+
# @deprecated 0.11.4 Replaced with RunLoop::XCTools.
|
66
72
|
# Does the instruments `version` accept the -s flag?
|
67
73
|
#
|
68
74
|
# @example
|
@@ -75,9 +81,11 @@ module Calabash
|
|
75
81
|
#
|
76
82
|
# @return [Boolean] true if the version is >= 5.*
|
77
83
|
def instruments_supports_hyphen_s?(version)
|
84
|
+
_deprecated('0.11.4', 'Use RunLoop::XCTools', :warn)
|
78
85
|
RunLoop::XCTools.new.instruments_supports_hyphen_s?(version)
|
79
86
|
end
|
80
87
|
|
88
|
+
# @deprecated 0.11.4 Replaced with RunLoop::XCTools.
|
81
89
|
# Returns a list of installed simulators by calling `$ instruments -s devices`.
|
82
90
|
# and parsing the output
|
83
91
|
# @return [Array<String>] an array of simulator names suitable for passing
|
@@ -85,6 +93,7 @@ module Calabash
|
|
85
93
|
# @raise [RuntimeError] if the currently active instruments version does
|
86
94
|
# not support the -s flag
|
87
95
|
def installed_simulators
|
96
|
+
_deprecated('0.11.4', 'Use RunLoop::XCTools', :warn)
|
88
97
|
instruments(:sims)
|
89
98
|
end
|
90
99
|
end
|
@@ -3,11 +3,11 @@ module Calabash
|
|
3
3
|
|
4
4
|
# @!visibility public
|
5
5
|
# The Calabash iOS gem version.
|
6
|
-
VERSION = '0.11.4
|
6
|
+
VERSION = '0.11.4'
|
7
7
|
|
8
8
|
# @!visibility public
|
9
9
|
# The minimum required version of the calabash.framework or, for Xamarin
|
10
10
|
# users, the Calabash component.
|
11
|
-
MIN_SERVER_VERSION = '0.11.4
|
11
|
+
MIN_SERVER_VERSION = '0.11.4'
|
12
12
|
end
|
13
13
|
end
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.4
|
4
|
+
version: 0.11.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Krukow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.0
|
173
|
+
version: 1.1.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.0
|
180
|
+
version: 1.1.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rake
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -304,6 +304,20 @@ dependencies:
|
|
304
304
|
- - "~>"
|
305
305
|
- !ruby/object:Gem::Version
|
306
306
|
version: '1.0'
|
307
|
+
- !ruby/object:Gem::Dependency
|
308
|
+
name: stub_env
|
309
|
+
requirement: !ruby/object:Gem::Requirement
|
310
|
+
requirements:
|
311
|
+
- - "~>"
|
312
|
+
- !ruby/object:Gem::Version
|
313
|
+
version: '0.2'
|
314
|
+
type: :development
|
315
|
+
prerelease: false
|
316
|
+
version_requirements: !ruby/object:Gem::Requirement
|
317
|
+
requirements:
|
318
|
+
- - "~>"
|
319
|
+
- !ruby/object:Gem::Version
|
320
|
+
version: '0.2'
|
307
321
|
description: calabash-cucumber drives tests for native iOS apps. You must link your
|
308
322
|
app with calabash-ios-server framework to execute tests.
|
309
323
|
email:
|
@@ -495,12 +509,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
495
509
|
version: '1.9'
|
496
510
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
497
511
|
requirements:
|
498
|
-
- - "
|
512
|
+
- - ">="
|
499
513
|
- !ruby/object:Gem::Version
|
500
|
-
version:
|
514
|
+
version: '0'
|
501
515
|
requirements: []
|
502
516
|
rubyforge_project:
|
503
|
-
rubygems_version: 2.
|
517
|
+
rubygems_version: 2.4.2
|
504
518
|
signing_key:
|
505
519
|
specification_version: 4
|
506
520
|
summary: Client for calabash-ios-server for automated functional testing on iOS
|