yolo 1.1.16 → 1.1.17
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yolo/deployment/ota.rb +1 -1
- data/lib/yolo/deployment/test_flight.rb +5 -9
- data/lib/yolo/notify/ios/email.html +7 -1
- data/lib/yolo/notify/ios/ota_email.rb +0 -1
- data/lib/yolo/tasks/ios/build.rb +1 -1
- data/lib/yolo/tasks/ios/coverage.rb +2 -2
- data/lib/yolo/tools/ios/calabash.rb +2 -6
- data/spec/deployment/ota_spec.rb +4 -8
- data/spec/deployment/test_flight_spec.rb +151 -1
- data/spec/notify/email_spec.rb +122 -1
- data/spec/notify/ios/ota_email_spec.rb +51 -1
- data/spec/tasks/base_task_spec.rb +22 -0
- data/spec/tasks/ios/build_spec.rb +22 -0
- data/spec/tasks/ios/calabash_spec.rb +21 -0
- data/spec/tasks/ios/coverage_spec.rb +32 -0
- data/spec/tasks/ios/ocunit_spec.rb +5 -0
- data/spec/tasks/ios/release_spec.rb +5 -0
- data/spec/tools/ios/calabash_spec.rb +18 -0
- metadata +8 -2
data/lib/yolo/deployment/ota.rb
CHANGED
@@ -23,17 +23,13 @@ module Yolo
|
|
23
23
|
IO.popen(curl_string(package_path, opts)) do |io|
|
24
24
|
begin
|
25
25
|
while line = io.readline
|
26
|
-
|
27
|
-
response << line
|
28
|
-
rescue StandardError => e
|
29
|
-
@error_formatter.deploy_failed("ParserError: #{e}")
|
30
|
-
end
|
26
|
+
response << line
|
31
27
|
end
|
32
|
-
rescue
|
33
|
-
|
34
|
-
|
28
|
+
rescue StandardError
|
29
|
+
@error_formatter.deploy_failed("Upload error")
|
30
|
+
end
|
35
31
|
end
|
36
|
-
upload_complete(response)
|
32
|
+
upload_complete(response) if response.length > 0
|
37
33
|
end
|
38
34
|
|
39
35
|
private
|
@@ -253,7 +253,10 @@
|
|
253
253
|
* @section button style
|
254
254
|
* @tip Set the styling for your email's button. Choose a style that draws attention.
|
255
255
|
*/
|
256
|
-
.templateButtonContent
|
256
|
+
.templateButtonContent {
|
257
|
+
padding: 0; /* Override standard td element styles */
|
258
|
+
}
|
259
|
+
.templateButtonContent a:link, .templateButtonContent a:visited, /* Yahoo! Mail Override */ .templateButtonContent a .yshortcuts /* Yahoo! Mail Override */{
|
257
260
|
/*@editable*/ color:#FFFFFF;
|
258
261
|
/*@editable*/ font-family:Helvetica;
|
259
262
|
/*@editable*/ font-size:18px;
|
@@ -261,6 +264,9 @@
|
|
261
264
|
/*@editable*/ line-height:100%;
|
262
265
|
text-align:center;
|
263
266
|
text-decoration:none;
|
267
|
+
display: inline-block;
|
268
|
+
width: 100%;
|
269
|
+
padding: 20px 0;
|
264
270
|
}
|
265
271
|
|
266
272
|
.bodyContent img{
|
data/lib/yolo/tasks/ios/build.rb
CHANGED
@@ -19,7 +19,7 @@ module Yolo
|
|
19
19
|
def build_opts_string(*additional_opts)
|
20
20
|
options = build_opts + additional_opts
|
21
21
|
if configuration == "Debug" or configuration.nil?
|
22
|
-
options = options << "CODE_SIGN_IDENTITY=
|
22
|
+
options = options << "CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO"
|
23
23
|
end
|
24
24
|
return options.compact.join(" ")
|
25
25
|
end
|
@@ -17,7 +17,7 @@ module Yolo
|
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
20
|
-
# Uses Xcode to find the full path to
|
20
|
+
# Uses Xcode to find the full path to the build objects
|
21
21
|
#
|
22
22
|
# @return [String] the path to the generated .app file
|
23
23
|
def build_path
|
@@ -26,7 +26,7 @@ module Yolo
|
|
26
26
|
files << path if path =~ /.*#{name}-.*\/Build\/Intermediates\/#{name}.build\/.*-iphonesimulator\/#{name}.build\/Objects-normal/
|
27
27
|
end
|
28
28
|
latest = files.sort_by { |filename| File.mtime(filename)}.last # get the latest
|
29
|
-
latest.split("/")[0..-2].join("/") # remove the file and get the dir
|
29
|
+
latest.split("/")[0..-2].join("/") if latest # remove the file and get the dir
|
30
30
|
end
|
31
31
|
|
32
32
|
#
|
@@ -19,14 +19,10 @@ module Yolo
|
|
19
19
|
IO.popen("cucumber --format #{format.to_s} --out #{output_dir}") do |io|
|
20
20
|
begin
|
21
21
|
while line = io.readline
|
22
|
-
|
23
|
-
puts line
|
24
|
-
rescue StandardError => e
|
25
|
-
puts "Error from output buffer: #{e.inspect}"
|
26
|
-
puts e.backtrace
|
27
|
-
end
|
22
|
+
puts line
|
28
23
|
end
|
29
24
|
rescue EOFError
|
25
|
+
puts "Error while executing"
|
30
26
|
end
|
31
27
|
end
|
32
28
|
$?.exitstatus if $?
|
data/spec/deployment/ota_spec.rb
CHANGED
@@ -18,7 +18,6 @@ describe Yolo::Deployment::OTA do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "when deploying" do
|
21
|
-
|
22
21
|
before do
|
23
22
|
@ota.stub(:upload)
|
24
23
|
end
|
@@ -67,8 +66,8 @@ describe Yolo::Deployment::OTA do
|
|
67
66
|
@ota.upload
|
68
67
|
end
|
69
68
|
|
70
|
-
it "should catch
|
71
|
-
@io.stub(:readline).and_raise(
|
69
|
+
it "should catch StandardError exceptions" do
|
70
|
+
@io.stub(:readline).and_raise(StandardError)
|
72
71
|
@error_formatter.should_receive(:deploy_failed).at_least(1).times
|
73
72
|
@ota.upload
|
74
73
|
end
|
@@ -85,11 +84,9 @@ describe Yolo::Deployment::OTA do
|
|
85
84
|
end
|
86
85
|
end
|
87
86
|
|
88
|
-
describe "
|
89
|
-
|
87
|
+
describe "when upload completes" do
|
90
88
|
before do
|
91
89
|
@ota.stub(:upload)
|
92
|
-
@json = "{'link':'test_link','password','test_password'}"
|
93
90
|
end
|
94
91
|
|
95
92
|
it "should catch json parse errors" do
|
@@ -98,12 +95,11 @@ describe Yolo::Deployment::OTA do
|
|
98
95
|
end
|
99
96
|
|
100
97
|
it "should parse the response" do
|
101
|
-
@ota.upload_complete(@json)
|
102
98
|
@ota.deploy("test", nil) do |url, password|
|
103
99
|
password.should eq("test_password")
|
104
100
|
url.should eq("test_link")
|
105
101
|
end
|
102
|
+
@ota.upload_complete('{"link":"test_link","password":"test_password"}')
|
106
103
|
end
|
107
|
-
|
108
104
|
end
|
109
105
|
end
|
@@ -1,8 +1,158 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'yolo/deployment'
|
3
3
|
require 'yolo/formatters'
|
4
|
+
require "yolo/tools/ios/release_notes"
|
5
|
+
require 'yolo/config'
|
4
6
|
|
5
7
|
describe Yolo::Deployment::TestFlight do
|
6
|
-
|
8
|
+
|
9
|
+
before do
|
10
|
+
@error_formatter = Yolo::Formatters::ErrorFormatter.new
|
11
|
+
Yolo::Formatters::ErrorFormatter.stub(:new){@error_formatter}
|
12
|
+
@error_formatter.stub(:deploy_failed)
|
13
|
+
Yolo::Formatters::ErrorFormatter.any_instance.stub(:puts)
|
14
|
+
Yolo::Formatters::ProgressFormatter.any_instance.stub(:puts)
|
15
|
+
Yolo::Formatters::ProgressFormatter.any_instance.stub(:deploying_ipa)
|
16
|
+
Yolo::Tools::Ios::ReleaseNotes.stub(:plaintext)
|
17
|
+
@tf = Yolo::Deployment::TestFlight.new
|
18
|
+
@tf.instance_variable_set(:@error_formatter, @error_formatter)
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "when deploying" do
|
22
|
+
before do
|
23
|
+
@tf.stub(:curl_string){"curlstring"}
|
24
|
+
@tf.stub(:upload_complete)
|
25
|
+
@io = mock(IO)
|
26
|
+
@io.stub(:readline)
|
27
|
+
IO.stub(:popen).and_yield(@io)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should execute a curl string" do
|
31
|
+
IO.should_receive(:popen).with("curlstring")
|
32
|
+
@tf.deploy("test")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should catch StandardError exceptions" do
|
36
|
+
@io.stub(:readline).and_raise(StandardError)
|
37
|
+
@error_formatter.should_receive(:deploy_failed).at_least(1).times
|
38
|
+
@tf.deploy("test")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should parse the response" do
|
42
|
+
@io.stub(:readline).and_return("response string", nil)
|
43
|
+
@tf.should_receive(:upload_complete).with("response string")
|
44
|
+
@tf.deploy("test")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should not complete with a nil response" do
|
48
|
+
@io.should_not_receive(:upload_complete)
|
49
|
+
@tf.deploy("test")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe "when parsing options" do
|
54
|
+
it "should parse the distribution lists" do
|
55
|
+
@tf.instance_eval{distribution_lists({:distribution_lists => ["test", "test"]})}.should eq("test,test")
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should parse the notify option" do
|
59
|
+
@tf.instance_eval{notify({:notify => true})}.should eq("True")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "when loading settings" do
|
64
|
+
it "should load the api token" do
|
65
|
+
Yolo::Config::Settings.instance.stub(:api_token){"apitoken"}
|
66
|
+
@tf.instance_eval{api_token}.should eq("apitoken")
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should load the team token" do
|
70
|
+
Yolo::Config::Settings.instance.stub(:team_token){"teamtoken"}
|
71
|
+
@tf.instance_eval{team_token}.should eq("teamtoken")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe "when loading notes" do
|
76
|
+
it "should set default notes" do
|
77
|
+
@tf.instance_eval{notes}.should eq("No notes provided")
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should load notes from release notes" do
|
81
|
+
Yolo::Tools::Ios::ReleaseNotes.stub(:plaintext){"test notes"}
|
82
|
+
@tf.instance_eval{notes}.should eq("test notes")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe "when the upload completes" do
|
87
|
+
before do
|
88
|
+
@io = mock(IO)
|
89
|
+
IO.stub(:popen).and_yield(@io)
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should catch json parse errors" do
|
93
|
+
@error_formatter.should_receive(:deploy_failed)
|
94
|
+
@tf.instance_eval{upload_complete("json")}
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should parse the response" do
|
98
|
+
@io.stub(:readline).and_return('{"install_url":"test_link"}', nil)
|
99
|
+
@tf.deploy("test", nil) do |url, password|
|
100
|
+
url.should eq("test_link")
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
describe "when building a curl string" do
|
106
|
+
before do
|
107
|
+
@tf.stub(:api_token){"apitoken"}
|
108
|
+
@tf.stub(:team_token){"teamtoken"}
|
109
|
+
@tf.stub(:notes){"notes"}
|
110
|
+
@tf.stub(:notify){"notify"}
|
111
|
+
@tf.stub(:distribution_lists){"list"}
|
112
|
+
end
|
113
|
+
|
114
|
+
it "should use curl" do
|
115
|
+
@tf.instance_eval{curl_string("test", nil)}.should match(/curl/)
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should set the correct URL" do
|
119
|
+
@tf.instance_eval{curl_string("test", nil)}.should match(/http:\/\/testflightapp.com\/api\/builds.json/)
|
120
|
+
end
|
121
|
+
|
122
|
+
it "should be a post request" do
|
123
|
+
@tf.instance_eval{curl_string("test", nil)}.should match(/-X POST -#/)
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should set the file path" do
|
127
|
+
@tf.instance_eval{curl_string("test", nil)}.should match(/-F file=@test/)
|
128
|
+
end
|
129
|
+
|
130
|
+
it "should set the api token" do
|
131
|
+
@tf.instance_eval{curl_string("test", nil)}.should match(/-F api_token='apitoken'/)
|
132
|
+
end
|
133
|
+
|
134
|
+
it "should set the team token" do
|
135
|
+
@tf.instance_eval{curl_string("test", nil)}.should match(/-F team_token='teamtoken'/)
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should set the notes" do
|
139
|
+
@tf.instance_eval{curl_string("test", nil)}.should match(/-F notes='notes'/)
|
140
|
+
end
|
141
|
+
|
142
|
+
it "should set the notify string" do
|
143
|
+
@tf.instance_eval{curl_string("test", {})}.should match(/-F notify=notify/)
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should set the distribution lists" do
|
147
|
+
@tf.instance_eval{curl_string("test", {})}.should match(/-F distribution_lists=list/)
|
148
|
+
end
|
149
|
+
|
150
|
+
it "should not set notify with no options" do
|
151
|
+
@tf.instance_eval{curl_string("test", nil)}.should_not match(/-F notify=notify/)
|
152
|
+
end
|
153
|
+
|
154
|
+
it "should not set distribution lists with no options" do
|
155
|
+
@tf.instance_eval{curl_string("test", nil)}.should_not match(/-F distribution_lists=list/)
|
156
|
+
end
|
7
157
|
end
|
8
158
|
end
|
data/spec/notify/email_spec.rb
CHANGED
@@ -1,8 +1,129 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'yolo/notify/email'
|
3
3
|
require 'yolo/formatters'
|
4
|
+
require 'yolo/config'
|
4
5
|
|
5
6
|
describe Yolo::Notify::Email do
|
6
|
-
|
7
|
+
|
8
|
+
before do
|
9
|
+
Yolo::Formatters::ErrorFormatter.any_instance.stub(:puts)
|
10
|
+
Yolo::Formatters::ProgressFormatter.any_instance.stub(:puts)
|
11
|
+
|
12
|
+
@settings = Yolo::Config::Settings
|
13
|
+
@settings.any_instance.stub(:mail_host){"test_host"}
|
14
|
+
@settings.any_instance.stub(:mail_from){"test_from"}
|
15
|
+
@settings.any_instance.stub(:mail_port){666}
|
16
|
+
@settings.any_instance.stub(:mail_account){"test_account"}
|
17
|
+
@settings.any_instance.stub(:mail_password){"test_password"}
|
18
|
+
@email = Yolo::Notify::Email.new
|
19
|
+
@email.stub(:body){"test body"}
|
20
|
+
@email.to = "test_to"
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "when initilized" do
|
24
|
+
it "should load a server" do
|
25
|
+
@email.server.should eq("test_host")
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should load a from address" do
|
29
|
+
@email.from.should eq("test_from")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should load a port" do
|
33
|
+
@email.port.should eq(666)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should load an account" do
|
37
|
+
@email.account.should eq("test_account")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should load a password" do
|
41
|
+
@email.password.should eq("test_password")
|
42
|
+
end
|
7
43
|
end
|
44
|
+
|
45
|
+
describe "when sending" do
|
46
|
+
before do
|
47
|
+
@smtp = mock(Net::SMTP)
|
48
|
+
Net::SMTP.stub(:new){@smtp}
|
49
|
+
@smtp.stub(:start).and_yield
|
50
|
+
@smtp.stub(:send_message)
|
51
|
+
@smtp.stub(:enable_starttls)
|
52
|
+
@options = {}
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "with an account" do
|
56
|
+
it "should send with tls" do
|
57
|
+
@smtp.should_receive(:enable_starttls)
|
58
|
+
@email.send(@options)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should send" do
|
62
|
+
@smtp.should_receive(:send_message).with("test body", "test_from", "test_to")
|
63
|
+
@email.send(@options)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "without an account" do
|
68
|
+
before do
|
69
|
+
@smtp.stub(:start).and_yield(@smtp)
|
70
|
+
@email.account = nil
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should not send with tls" do
|
74
|
+
@smtp.should_not_receive(:enable_starttls)
|
75
|
+
@email.send(@options)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should send" do
|
79
|
+
@smtp.should_receive(:send_message).with("test body", "test_from", "test_to")
|
80
|
+
@email.send(@options)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "and loading options" do
|
85
|
+
|
86
|
+
before do
|
87
|
+
@email.to = "test_to"
|
88
|
+
@email.send(@options)
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should load a server if missing" do
|
92
|
+
@options[:server].should eq("test_host")
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should load a from address if missing" do
|
96
|
+
@options[:from].should eq("test_from")
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should load a subject if missing" do
|
100
|
+
@options[:subject].should eq("New Build!")
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should load a title if missing" do
|
104
|
+
@options[:title].should eq("New Build!")
|
105
|
+
end
|
106
|
+
|
107
|
+
it "should load a body if missing" do
|
108
|
+
@options[:body].should eq("test body")
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should load a password if missing" do
|
112
|
+
@options[:password].should eq("test_password")
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should load an account if missing" do
|
116
|
+
@options[:account].should eq("test_account")
|
117
|
+
end
|
118
|
+
|
119
|
+
it "should load a port if missing" do
|
120
|
+
@options[:port].should eq(666)
|
121
|
+
end
|
122
|
+
|
123
|
+
it "should load a to address if missing" do
|
124
|
+
@options[:to].should eq("test_to")
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
8
129
|
end
|
@@ -2,8 +2,58 @@ require 'spec_helper'
|
|
2
2
|
require 'yolo/notify/email'
|
3
3
|
require 'yolo/notify/ios'
|
4
4
|
require 'yolo/formatters'
|
5
|
+
require 'yolo/config'
|
6
|
+
require 'yolo/tools'
|
5
7
|
|
6
8
|
describe Yolo::Notify::Ios::OTAEmail do
|
7
|
-
|
9
|
+
|
10
|
+
before do
|
11
|
+
Yolo::Formatters::ErrorFormatter.any_instance.stub(:puts)
|
12
|
+
Yolo::Formatters::ProgressFormatter.any_instance.stub(:puts)
|
13
|
+
|
14
|
+
@settings = Yolo::Config::Settings
|
15
|
+
@settings.any_instance.stub(:mail_host){"test_host"}
|
16
|
+
@settings.any_instance.stub(:mail_from){"test_from"}
|
17
|
+
@settings.any_instance.stub(:mail_port){666}
|
18
|
+
@settings.any_instance.stub(:mail_account){"test_account"}
|
19
|
+
@settings.any_instance.stub(:mail_password){"test_password"}
|
20
|
+
|
21
|
+
@options = {:ota_password => "test_password", :ota_url => "test_url", :title => "test_title", :subject => "test subject"}
|
22
|
+
|
23
|
+
Yolo::Tools::Ios::ReleaseNotes.stub(:html){"test markdown"}
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "when generating the body" do
|
27
|
+
before do
|
28
|
+
@email = Yolo::Notify::Ios::OTAEmail.new
|
29
|
+
file = mock(File)
|
30
|
+
file.stub(:read){"YOLO.TITLE YOLO.CONTENT YOLO.PASSWORD YOLO.LINK"}
|
31
|
+
File.stub(:open){file}
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should contain the subject" do
|
35
|
+
@email.body(@options).should match(/test subject/)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should contain the password" do
|
39
|
+
@email.body(@options).should match(/test_password/)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should contain the link" do
|
43
|
+
@email.body(@options).should match(/test_url/)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should contain the markdown" do
|
47
|
+
@email.body(@options).should match(/test markdown/)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should contain the title" do
|
51
|
+
@email.body(@options).should match(/test_title/)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should remove the template password if password is missing" do
|
55
|
+
@options[:ota_password] = nil
|
56
|
+
@email.body(@options).should_not match(/YOLO.PASSWORD/)
|
57
|
+
end
|
8
58
|
end
|
9
59
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'yolo/tasks'
|
2
|
+
|
3
|
+
describe Yolo::Tasks::BaseTask do
|
4
|
+
|
5
|
+
describe "when returning a name" do
|
6
|
+
before do
|
7
|
+
@basetask = Yolo::Tasks::BaseTask.new
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should return a target name if no scheme is set" do
|
11
|
+
@basetask.scheme = nil
|
12
|
+
@basetask.target = "TestTarget"
|
13
|
+
@basetask.name.should eq("TestTarget")
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return a scheme name if a scheme is set" do
|
17
|
+
@basetask.scheme = "TestScheme"
|
18
|
+
@basetask.target = nil
|
19
|
+
@basetask.name.should eq("TestScheme")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'yolo/tasks'
|
2
|
+
|
3
|
+
describe Yolo::Tasks::Ios::Build do
|
4
|
+
describe "when building an options string" do
|
5
|
+
before do
|
6
|
+
@buildtask = Yolo::Tasks::Ios::Build.new
|
7
|
+
end
|
8
|
+
|
9
|
+
after do
|
10
|
+
@buildtask.configuration = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should append any additional options" do
|
14
|
+
@buildtask.build_opts_string("one", "two", "three").should match(/one two three/)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should skip code signing if a debug build" do
|
18
|
+
@buildtask.configuration = "Debug"
|
19
|
+
@buildtask.build_opts_string.should match(/CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO/)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'yolo/tasks'
|
2
|
+
|
3
|
+
describe Yolo::Tasks::Ios::Calabash do
|
4
|
+
before do
|
5
|
+
@calabash = Yolo::Tasks::Ios::Calabash.new
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "when created" do
|
9
|
+
it "should set junit as the default format" do
|
10
|
+
@calabash.format.should eq(:junit)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should set the iphonesimulator as the default sdk" do
|
14
|
+
@calabash.sdk.should eq("iphonesimulator")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should set test-reports/calabash as the default output directory" do
|
18
|
+
@calabash.output_dir.should eq("test-reports/calabash")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'yolo/tasks'
|
2
|
+
require 'yolo/tools'
|
3
|
+
require 'active_support/all'
|
4
|
+
describe Yolo::Tasks::Ios::Coverage do
|
5
|
+
before do
|
6
|
+
@xcode = mock(Yolo::Tools::Ios::Xcode)
|
7
|
+
@xcode.stub(:build_path)
|
8
|
+
Yolo::Tools::Ios::Xcode.stub(:new){@xcode}
|
9
|
+
@coverage = Yolo::Tasks::Ios::Coverage.new
|
10
|
+
@test_path = "blah/name-test/Build/Intermediates/name.build/Debug-iphonesimulator/name.build/Objects-normal"
|
11
|
+
@false_path = "blah/name-false/Build/Intermediates/name.build/Debug-iphonesimulator/name.build/Objects-normal"
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "when getting a build path" do
|
15
|
+
|
16
|
+
before do
|
17
|
+
@coverage.stub(:name){"name"}
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should find the directory" do
|
21
|
+
Find.stub(:find).and_yield(@test_path)
|
22
|
+
File.stub(:mtime){Time.now}
|
23
|
+
@coverage.build_path.should eq("blah/name-test/Build/Intermediates/name.build/Debug-iphonesimulator/name.build")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should find the latest directory" do
|
27
|
+
Find.stub(:find).and_yield(@test_path).and_yield(@false_path)
|
28
|
+
File.stub(:mtime).and_return(Time.now, Time.now - 1.day)
|
29
|
+
@coverage.build_path.should eq("blah/name-test/Build/Intermediates/name.build/Debug-iphonesimulator/name.build")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -9,6 +9,12 @@ describe Yolo::Tools::Ios::Calabash do
|
|
9
9
|
|
10
10
|
describe "when running " do
|
11
11
|
|
12
|
+
before do
|
13
|
+
@io = mock(IO)
|
14
|
+
IO.stub(:popen).and_yield(@io)
|
15
|
+
@io.stub(:readline)
|
16
|
+
end
|
17
|
+
|
12
18
|
it "should execute the cucumber command" do
|
13
19
|
IO.should_receive(:popen).with(/cucumber/)
|
14
20
|
Yolo::Tools::Ios::Calabash.run()
|
@@ -24,6 +30,18 @@ describe Yolo::Tools::Ios::Calabash do
|
|
24
30
|
Yolo::Tools::Ios::Calabash.run()
|
25
31
|
end
|
26
32
|
|
33
|
+
it "should output to STDOUT" do
|
34
|
+
@io.stub(:readline).and_return("testline", nil)
|
35
|
+
Yolo::Tools::Ios::Calabash.should_receive(:puts).with("testline")
|
36
|
+
Yolo::Tools::Ios::Calabash.run
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should catch EOFError exceptions" do
|
40
|
+
@io.stub(:readline).and_raise(EOFError)
|
41
|
+
Yolo::Tools::Ios::Calabash.should_receive(:puts)
|
42
|
+
Yolo::Tools::Ios::Calabash.run
|
43
|
+
end
|
44
|
+
|
27
45
|
end
|
28
46
|
|
29
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yolo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.17
|
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-05-
|
12
|
+
date: 2013-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: xcodebuild-rb
|
@@ -123,6 +123,12 @@ files:
|
|
123
123
|
- spec/notify/email_spec.rb
|
124
124
|
- spec/notify/ios/ota_email_spec.rb
|
125
125
|
- spec/spec_helper.rb
|
126
|
+
- spec/tasks/base_task_spec.rb
|
127
|
+
- spec/tasks/ios/build_spec.rb
|
128
|
+
- spec/tasks/ios/calabash_spec.rb
|
129
|
+
- spec/tasks/ios/coverage_spec.rb
|
130
|
+
- spec/tasks/ios/ocunit_spec.rb
|
131
|
+
- spec/tasks/ios/release_spec.rb
|
126
132
|
- spec/tools/git_spec.rb
|
127
133
|
- spec/tools/ios/calabash_spec.rb
|
128
134
|
- spec/tools/ios/coverage_spec.rb
|