tddium-preview 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +8 -6
- data/bin/tddium +1 -1
- data/features/account_command.feature +2 -1
- data/features/activate_command.feature +2 -0
- data/features/login_command.feature +2 -0
- data/features/logout_command.feature +2 -0
- data/features/step_definitions/account_steps.rb +2 -0
- data/features/step_definitions/activate_steps.rb +2 -0
- data/features/step_definitions/aruba_steps.rb +1 -0
- data/features/step_definitions/login_steps.rb +2 -0
- data/features/step_definitions/mimic_steps.rb +2 -0
- data/features/step_definitions/suite_steps.rb +2 -0
- data/features/suite_command.feature +2 -3
- data/features/support/aruba.rb +2 -0
- data/features/support/constants.rb +2 -0
- data/features/support/env.rb +2 -0
- data/features/support/mimic.rb +1 -2
- data/lib/tddium.rb +19 -5
- data/lib/tddium/constant.rb +13 -10
- data/lib/tddium/version.rb +1 -1
- metadata +22 -22
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tddium-preview (0.9.
|
4
|
+
tddium-preview (0.9.3)
|
5
5
|
bundler
|
6
6
|
highline
|
7
7
|
json
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: http://rubygems.org/
|
14
14
|
specs:
|
15
|
-
antilles (0.1.
|
15
|
+
antilles (0.1.4)
|
16
16
|
bundler
|
17
17
|
daemons
|
18
18
|
httparty
|
@@ -29,7 +29,6 @@ GEM
|
|
29
29
|
builder (3.0.0)
|
30
30
|
childprocess (0.2.2)
|
31
31
|
ffi (~> 1.0.6)
|
32
|
-
crack (0.1.8)
|
33
32
|
cucumber (1.0.2)
|
34
33
|
builder (>= 2.1.2)
|
35
34
|
diff-lcs (>= 1.1.2)
|
@@ -43,19 +42,22 @@ GEM
|
|
43
42
|
gherkin (2.4.21)
|
44
43
|
json (>= 1.4.6)
|
45
44
|
highline (1.6.2)
|
46
|
-
httparty (0.
|
47
|
-
|
45
|
+
httparty (0.8.0)
|
46
|
+
multi_json
|
47
|
+
multi_xml
|
48
48
|
json (1.6.1)
|
49
49
|
mimic (0.4.3)
|
50
50
|
json
|
51
51
|
plist
|
52
52
|
rack
|
53
53
|
sinatra
|
54
|
+
multi_json (1.0.3)
|
55
|
+
multi_xml (0.4.1)
|
54
56
|
pickle (0.4.8)
|
55
57
|
cucumber (>= 0.8)
|
56
58
|
rake
|
57
59
|
plist (3.1.0)
|
58
|
-
rack (1.3.
|
60
|
+
rack (1.3.3)
|
59
61
|
rake (0.9.2)
|
60
62
|
rdiscount (1.6.8)
|
61
63
|
rspec (2.6.0)
|
data/bin/tddium
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# Copyright (c) 2011 Solano Labs All Rights Reserved
|
2
|
+
|
1
3
|
@mimic
|
2
4
|
Feature: suite command
|
3
5
|
As a user
|
@@ -43,6 +45,3 @@ Feature: suite command
|
|
43
45
|
Then the output from "tddium suite" should contain "Created suite..."
|
44
46
|
When the console session ends
|
45
47
|
Then the exit status should be 0
|
46
|
-
|
47
|
-
|
48
|
-
|
data/features/support/aruba.rb
CHANGED
data/features/support/env.rb
CHANGED
data/features/support/mimic.rb
CHANGED
data/lib/tddium.rb
CHANGED
@@ -92,7 +92,8 @@ class Tddium < Thor
|
|
92
92
|
write_api_key(new_user["user"]["api_key"])
|
93
93
|
role = new_user["user"]["account_role"]
|
94
94
|
if role.nil? || role == "owner"
|
95
|
-
|
95
|
+
u = new_user["user"]
|
96
|
+
say Text::Process::ACCOUNT_CREATED % [u["email"], u["trial_remaining"], u["recurly_url"]]
|
96
97
|
else
|
97
98
|
say Text::Process::ACCOUNT_ADDED % [new_user["user"]["email"], new_user["user"]["account_role"], new_user["user"]["account"]]
|
98
99
|
end
|
@@ -432,9 +433,13 @@ class Tddium < Thor
|
|
432
433
|
|
433
434
|
def call_api(method, api_path, params = {}, api_key = nil, show_error = true)
|
434
435
|
api_key = tddium_settings(:fail_with_message => false)["api_key"] if tddium_settings(:fail_with_message => false) && api_key != false
|
436
|
+
params[:tddium_gem_version] = TddiumVersion::VERSION
|
435
437
|
begin
|
436
438
|
result = tddium_client.call_api(method, api_path, params, api_key)
|
437
439
|
rescue TddiumClient::Error::Base => e
|
440
|
+
|
441
|
+
exit_failure e.message if e.status == Api::ErrorCode::GEM_OUT_OF_DATE
|
442
|
+
|
438
443
|
say e.message if show_error
|
439
444
|
raise e
|
440
445
|
end
|
@@ -581,6 +586,15 @@ class Tddium < Thor
|
|
581
586
|
message.nil?
|
582
587
|
end
|
583
588
|
|
589
|
+
def git_root
|
590
|
+
root = `git rev-parse --show-toplevel 2>&1`
|
591
|
+
if $?.exitstatus == 0 then
|
592
|
+
root.chomp! if root
|
593
|
+
return root
|
594
|
+
end
|
595
|
+
return Dir.pwd
|
596
|
+
end
|
597
|
+
|
584
598
|
def git_origin_url
|
585
599
|
result = `(git config --get remote.origin.url || echo GIT_FAILED) 2>/dev/null`
|
586
600
|
return nil if result =~ /GIT_FAILED/
|
@@ -593,7 +607,7 @@ class Tddium < Thor
|
|
593
607
|
|
594
608
|
def handle_heroku_user(options, heroku_config)
|
595
609
|
api_key = heroku_config['TDDIUM_API_KEY']
|
596
|
-
user =
|
610
|
+
user = call_api(:get, Api::Path::USERS, {}, api_key, false) rescue nil
|
597
611
|
exit_failure Text::Error::HEROKU_MISCONFIGURED % "Unrecognized user" unless user
|
598
612
|
say Text::Process::HEROKU_WELCOME % user["user"]["email"]
|
599
613
|
|
@@ -610,7 +624,7 @@ class Tddium < Thor
|
|
610
624
|
|
611
625
|
begin
|
612
626
|
user_id = user["user"]["id"]
|
613
|
-
result =
|
627
|
+
result = call_api(:put, "#{Api::Path::USERS}/#{user_id}/", {:user=>params, :heroku_activation=>true}, api_key)
|
614
628
|
rescue TddiumClient::Error::API => e
|
615
629
|
exit_failure Text::Error::HEROKU_MISCONFIGURED % e
|
616
630
|
rescue TddiumClient::Error::Base => e
|
@@ -808,7 +822,7 @@ puts "EXN: #{e.inspect}"
|
|
808
822
|
|
809
823
|
def tddium_deploy_key_file_name
|
810
824
|
extension = ".#{environment}" unless environment == :production
|
811
|
-
".tddium-deploy-key#{extension}"
|
825
|
+
return File.join(git_root, ".tddium-deploy-key#{extension}")
|
812
826
|
end
|
813
827
|
|
814
828
|
def suite_for_current_branch?
|
@@ -829,7 +843,7 @@ puts "EXN: #{e.inspect}"
|
|
829
843
|
|
830
844
|
def tddium_file_name
|
831
845
|
extension = ".#{environment}" unless environment == :production
|
832
|
-
".tddium#{extension}"
|
846
|
+
return File.join(git_root, ".tddium#{extension}")
|
833
847
|
end
|
834
848
|
|
835
849
|
def tddium_settings(options = {})
|
data/lib/tddium/constant.rb
CHANGED
@@ -22,6 +22,7 @@ module TddiumConstant
|
|
22
22
|
module Git
|
23
23
|
REMOTE_NAME = "tddium"
|
24
24
|
GITIGNORE = ".gitignore"
|
25
|
+
READY_TRIES = 3
|
25
26
|
end
|
26
27
|
|
27
28
|
module Api
|
@@ -39,6 +40,7 @@ module TddiumConstant
|
|
39
40
|
end
|
40
41
|
module ErrorCode
|
41
42
|
INVALID_INVITATION = 2
|
43
|
+
GEM_OUT_OF_DATE = 10000
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
@@ -99,12 +101,15 @@ Next, you should:
|
|
99
101
|
1. Register your test suite by running:
|
100
102
|
tddium suite
|
101
103
|
|
102
|
-
2.
|
103
|
-
%s
|
104
|
-
|
105
|
-
3. Start tests by running:
|
104
|
+
2. Start tests by running:
|
106
105
|
tddium spec
|
107
106
|
|
107
|
+
You have %s days left in your free trial.
|
108
|
+
|
109
|
+
To sign up a for a billing plan, open this URL in your browser:
|
110
|
+
|
111
|
+
%s
|
112
|
+
|
108
113
|
"
|
109
114
|
ACCOUNT_ADDED = "
|
110
115
|
Congratulations %s, your tddium account has been activated.
|
@@ -208,14 +213,12 @@ EOF
|
|
208
213
|
SEPARATOR = "====="
|
209
214
|
USING_SUITE = "Using suite...\n\n%s"
|
210
215
|
USER_DETAILS =<<EOF;
|
216
|
+
|
211
217
|
Username: <%=user["email"]%>
|
212
218
|
Account Created: <%=user["created_at"]%>
|
213
|
-
<% if user["
|
214
|
-
|
215
|
-
<% end %>
|
216
|
-
<% if user["heroku"] %>
|
217
|
-
Heroku Account Linked: <%=user["heroku_activation_done"]%>
|
218
|
-
<% end %>
|
219
|
+
<% if user["trial_remaining"] && user["trial_remaining"] > 0 %>Trial Period Remaining: <%=user["trial_remaining"]%> days<% end %>
|
220
|
+
<% if user["recurly_url"] %>Account Management URL: <%=user["recurly_url"]%><% end %>
|
221
|
+
<% if user["heroku"] %>Heroku Account Linked: <%=user["heroku_activation_done"]%><% end %>
|
219
222
|
EOF
|
220
223
|
HEROKU_CONFIG = "
|
221
224
|
Tddium is configured to work with your Heroku app.
|
data/lib/tddium/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tddium-preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
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: 2011-09-
|
12
|
+
date: 2011-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &18134260 !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: *
|
24
|
+
version_requirements: *18134260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|
27
|
-
requirement: &
|
27
|
+
requirement: &18133840 !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: *
|
35
|
+
version_requirements: *18133840
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: json
|
38
|
-
requirement: &
|
38
|
+
requirement: &18133420 !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: *
|
46
|
+
version_requirements: *18133420
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: tddium_client
|
49
|
-
requirement: &
|
49
|
+
requirement: &18132920 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.0.10
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *18132920
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: tddium_reporting
|
60
|
-
requirement: &
|
60
|
+
requirement: &18132420 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.0.5
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *18132420
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
|
-
requirement: &
|
71
|
+
requirement: &18130200 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *18130200
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rspec
|
82
|
-
requirement: &
|
82
|
+
requirement: &18129700 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *18129700
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: fakefs
|
93
|
-
requirement: &
|
93
|
+
requirement: &18129240 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *18129240
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: simplecov
|
104
|
-
requirement: &
|
104
|
+
requirement: &18128820 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *18128820
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rake
|
115
|
-
requirement: &
|
115
|
+
requirement: &18128400 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,7 +120,7 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *18128400
|
124
124
|
description: ! 'tddium runs your rspec, cucumber, and test::unit tests in our managed
|
125
125
|
|
126
126
|
cloud environment. You can run tests by hand, or enable our hosted CI to watch
|