calasmash 0.0.9 → 0.0.10

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.
@@ -1,3 +1,3 @@
1
1
  module Calasmash
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
data/lib/calasmash.rb CHANGED
@@ -22,6 +22,7 @@ module Calasmash
22
22
  puts "Starting..."
23
23
  compile
24
24
  update_plist
25
+ delete_simulator_plist
25
26
  sleep(2)
26
27
  run_cucumber
27
28
  end
@@ -57,6 +58,10 @@ module Calasmash
57
58
  opt.on('-o', "--out OUTPUT", "test report output path e.g. test") do |tags|
58
59
  options[:out] = tags
59
60
  end
61
+
62
+ opt.on('-ios', "--ios OS", "iOS simulator version of the sdk to run e.g. 6.0 or 7.0") do |tags|
63
+ options[:ios] = tags
64
+ end
60
65
  end
61
66
 
62
67
  @opt_parser.parse! args
@@ -122,9 +127,22 @@ module Calasmash
122
127
 
123
128
  end
124
129
 
130
+ def delete_simulator_plist
131
+ puts "Deleting simulator plist..."
132
+ # Delete last known simulator preference to prevent running in the wrong simulator
133
+ FileUtils.rm(simulator_plist_path, :force => true)
134
+ end
135
+
125
136
  def run_cucumber
126
137
  puts "Running cucumber..."
127
138
 
139
+ # Which iOS simulator to run if specified else uses default for the platform
140
+ os_params = ""
141
+ if(@options[:ios])
142
+ os = @options[:ios]
143
+ os_params = " OS=ios#{os.to_i} SDK_VERSION=#{os}"
144
+ end
145
+
128
146
  optional_params = ""
129
147
  if(@options[:out] && @options[:format])
130
148
  optional_params = " --format #{@options[:format]} --out #{@options[:out]} "
@@ -136,9 +154,13 @@ module Calasmash
136
154
  end
137
155
  end
138
156
 
139
- cucumber_command = "cucumber OS=ios7 SDK_VERSION=7.0 DEVICE_TARGET=simulator"
157
+ cucumber_command = "cucumber"
158
+ cucumber_command += os_params
159
+ cucumber_command += " DEVICE_TARGET=simulator"
140
160
  cucumber_command += optional_params
141
161
 
162
+ puts("#{cucumber_command}")
163
+
142
164
  status = nil
143
165
  Open3.popen3 cucumber_command do |stdin, out, err, wait_thr|
144
166
 
@@ -179,6 +201,10 @@ module Calasmash
179
201
  plist_path = app_path + "/server_config.plist"
180
202
  return plist_path
181
203
  end
204
+
205
+ def simulator_plist_path
206
+ return "#{File.expand_path('~')}/Library/Preferences/com.apple.iphonesimulator.plist"
207
+ end
182
208
  end
183
209
  end
184
210
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calasmash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-06 00:00:00.000000000 Z
12
+ date: 2013-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 1.8.23
102
+ rubygems_version: 1.8.24
103
103
  signing_key:
104
104
  specification_version: 3
105
105
  summary: Compile an app, run sinatra, point the app at sinatra, run the app tests