calabash-cucumber 0.9.47 → 0.9.48

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- calabash-cucumber (0.9.41)
4
+ calabash-cucumber (0.9.48)
5
5
  CFPropertyList
6
6
  cucumber
7
7
  json
@@ -26,8 +26,8 @@ GEM
26
26
  gherkin (2.9.0)
27
27
  json (>= 1.4.6)
28
28
  json (1.6.5)
29
- libxml-ruby (2.2.2)
30
- net-http-persistent (2.5.2)
29
+ libxml-ruby (2.3.0)
30
+ net-http-persistent (2.6)
31
31
  rack (1.4.1)
32
32
  rack-protection (1.2.0)
33
33
  rack
data/bin/CalabashSetup CHANGED
Binary file
@@ -45,9 +45,6 @@ def calabash_setup(args)
45
45
  puts "Go to your project (the dir containing the .xcodeproj file)."
46
46
  puts "Then run calabash-ios gen"
47
47
  puts "(if you don't already have a features folder)."
48
- sleep 2
49
- system(%Q[open "#{xpath}"])
50
-
51
48
  end
52
49
 
53
50
  else
@@ -97,6 +94,15 @@ def calabash_download(args)
97
94
  download_calabash(File.expand_path("."))
98
95
  end
99
96
 
97
+ def has_proxy?
98
+ ENV['http_proxy'] ? true : false
99
+ end
100
+
101
+ def proxy
102
+ url_parts = URI.split(ENV['http_proxy'])
103
+ [url_parts[2], url_parts[3]]
104
+ end
105
+
100
106
  def download_calabash(project_path)
101
107
  file = 'calabash.framework'
102
108
  ##Download calabash.framework
@@ -109,7 +115,13 @@ def download_calabash(project_path)
109
115
 
110
116
  uri = URI.parse "http://cloud.github.com/downloads/calabash/calabash-ios/#{zip_file}"
111
117
  success = false
112
- Net::HTTP.start(uri.host, uri.port) do |http|
118
+ if has_proxy?
119
+ proxy_url = proxy
120
+ connection = Net::HTTP::Proxy(proxy_url[0], proxy_url[1])
121
+ else
122
+ connection = Net::HTTP
123
+ end
124
+ connection.start(uri.host, uri.port) do |http|
113
125
  request = Net::HTTP::Get.new uri.request_uri
114
126
 
115
127
  http.request request do |response|
@@ -22,18 +22,36 @@
22
22
  ########################################
23
23
 
24
24
  require 'calabash-cucumber/launch/simulator_helper'
25
+ require 'sim_launcher'
25
26
 
26
27
  # Uncomment and replace ?? appropriately
27
28
  # This should point to your Simulator build
28
29
  # which includes calabash framework
29
30
  # this is usually the Calabash build configuration
30
31
  # of your production target.
31
- #APP_BUNDLE_PATH = "~/Library/Developer/Xcode/DerivedData/??/Build/Products/Calabash-iphonesimulator/??.app""
32
+ #APP_BUNDLE_PATH = "~/Library/Developer/Xcode/DerivedData/??/Build/Products/Calabash-iphonesimulator/??.app"
32
33
  #
33
34
 
35
+ def reset_app_jail(sdk, app_path)
36
+ app = File.basename(app_path)
37
+ bundle = `find "#{ENV['HOME']}/Library/Application Support/iPhone Simulator/#{sdk}/Applications/" -type d -depth 2 -name #{app} | head -n 1`
38
+ return if bundle.empty? # Assuming we're already clean
39
+
40
+ sandbox = File.dirname(bundle)
41
+ ['Library', 'Documents', 'tmp'].each do |dir|
42
+ FileUtils.rm_rf(File.join(sandbox, dir))
43
+ end
44
+ end
45
+
34
46
  def relaunch
35
- if ENV['NO_LAUNCH'].nil?
36
- Calabash::Cucumber::SimulatorHelper.relaunch(app_path,ENV['SDK_VERSION'],ENV['DEVICE'] || 'iphone')
47
+ if ENV['NO_LAUNCH']!="1"
48
+ sdk = ENV['SDK_VERSION'] || SimLauncher::SdkDetector.new().latest_sdk_version
49
+ path = Calabash::Cucumber::SimulatorHelper.app_bundle_or_raise(app_path)
50
+ if ENV['RESET_BETWEEN_SCENARIOS']=="1"
51
+ reset_app_jail(sdk, path)
52
+ end
53
+
54
+ Calabash::Cucumber::SimulatorHelper.relaunch(path,sdk,ENV['DEVICE'] || 'iphone')
37
55
  end
38
56
  end
39
57
 
@@ -42,14 +60,12 @@ def app_path
42
60
  ENV['APP_BUNDLE_PATH'] || (defined?(APP_BUNDLE_PATH) && APP_BUNDLE_PATH)
43
61
  end
44
62
 
45
- ##TODO Reset simulator between features!
46
-
47
63
  Before do |scenario|
48
64
  relaunch
49
65
  end
50
66
 
51
67
  at_exit do
52
- if ENV['NO_LAUNCH'].nil? and ENV['NO_STOP'].nil?
68
+ if ENV['NO_LAUNCH']!="1" and ENV['NO_STOP']!="1"
53
69
  Calabash::Cucumber::SimulatorHelper.stop
54
70
  end
55
- end
71
+ end
@@ -394,7 +394,7 @@ module Operations
394
394
 
395
395
 
396
396
  def url_for( verb )
397
- url = URI.parse (ENV['DEVICE_ENDPOINT']|| "http://localhost:37265/")
397
+ url = URI.parse(ENV['DEVICE_ENDPOINT']|| "http://localhost:37265/")
398
398
  url.path = '/'+verb
399
399
  url
400
400
  end
@@ -1,6 +1,6 @@
1
1
  module Calabash
2
2
  module Cucumber
3
- VERSION = "0.9.47"
4
- FRAMEWORK_VERSION = "0.9.43"
3
+ VERSION = "0.9.48"
4
+ FRAMEWORK_VERSION = "0.9.48"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.47
4
+ version: 0.9.48
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-12 00:00:00.000000000 Z
12
+ date: 2012-04-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber
16
- requirement: &70176435685240 !ruby/object:Gem::Requirement
16
+ requirement: &70222530853720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70176435685240
24
+ version_requirements: *70222530853720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &70176435684360 !ruby/object:Gem::Requirement
27
+ requirement: &70222530851080 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70176435684360
35
+ version_requirements: *70222530851080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: CFPropertyList
38
- requirement: &70176435683740 !ruby/object:Gem::Requirement
38
+ requirement: &70222530848560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70176435683740
46
+ version_requirements: *70222530848560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sim_launcher
49
- requirement: &70176435683060 !ruby/object:Gem::Requirement
49
+ requirement: &70222530846780 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70176435683060
57
+ version_requirements: *70222530846780
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: slowhandcuke
60
- requirement: &70176435682580 !ruby/object:Gem::Requirement
60
+ requirement: &70222530845600 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70176435682580
68
+ version_requirements: *70222530845600
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: net-http-persistent
71
- requirement: &70176435682040 !ruby/object:Gem::Requirement
71
+ requirement: &70222530843660 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70176435682040
79
+ version_requirements: *70222530843660
80
80
  description: calabash-cucumber drives tests for native iOS apps. You must link your
81
81
  app with calabash-ios-server framework to execute tests.
82
82
  email: