tddium-preview 0.6.14 → 0.6.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tddium/constant.rb +21 -1
- data/lib/tddium/version.rb +1 -1
- data/lib/tddium.rb +7 -5
- data/spec/spec_helper.rb +13 -0
- data/spec/tddium_spec.rb +9 -7
- metadata +2 -2
data/lib/tddium/constant.rb
CHANGED
@@ -67,6 +67,10 @@ module TddiumConstant
|
|
67
67
|
CAMPFIRE_TOKEN = "Enter your Campfire API Token (default '%s'):"
|
68
68
|
end
|
69
69
|
|
70
|
+
module Warning
|
71
|
+
GIT_CHANGES_NOT_COMMITTED = "Uncommitted changes in local git repository"
|
72
|
+
end
|
73
|
+
|
70
74
|
module Process
|
71
75
|
TERMINATE_INSTRUCTION = "Press Ctrl-C to stop waiting. Tests will continue running."
|
72
76
|
INTERRUPT = "Interrupted"
|
@@ -231,7 +235,23 @@ EOF
|
|
231
235
|
module Error
|
232
236
|
NOT_INITIALIZED = "tddium must be initialized. Try 'tddium login'"
|
233
237
|
INVALID_TDDIUM_FILE = ".tddium.%s config file is corrupt. Try 'tddium login'"
|
234
|
-
GIT_NOT_INITIALIZED
|
238
|
+
GIT_NOT_INITIALIZED =<<EOF;
|
239
|
+
It doesn't look like you're in a git repo. If you're not, use 'git init' to
|
240
|
+
create one.
|
241
|
+
|
242
|
+
If you are in a git repo and you're still seeing this message,
|
243
|
+
you may be using an unsupported version of git.
|
244
|
+
|
245
|
+
Please email us at info@tddium.com with the following trace information:
|
246
|
+
|
247
|
+
>>>>>>>>>>>>> BEGIN GIT TRACE >>>>>>>>>>>>>>>>>>>>>>>>>
|
248
|
+
git version: #{`git --version 2>&1`}
|
249
|
+
git status: #{`git status 2>&1`}
|
250
|
+
git status result: #{ $? }
|
251
|
+
git details: #{`git status --porcelain 2>&1`}
|
252
|
+
git details result: #{ $? }
|
253
|
+
>>>>>>>>>>>>> END GIT TRACE >>>>>>>>>>>>>>>>>>>>>>>>>
|
254
|
+
EOF
|
235
255
|
NO_SUITE_EXISTS = "No suite exists for the branch '%s'. Try running 'tddium suite'"
|
236
256
|
INVALID_INVITATION = "
|
237
257
|
Your invitation token wasn't recognized. If you have a token, make sure you enter it correctly.
|
data/lib/tddium/version.rb
CHANGED
data/lib/tddium.rb
CHANGED
@@ -14,7 +14,6 @@ require File.expand_path("../tddium/version", __FILE__)
|
|
14
14
|
require File.expand_path("../tddium/heroku", __FILE__)
|
15
15
|
|
16
16
|
# Usage:
|
17
|
-
|
18
17
|
# tddium suite # Register the suite for this rails app, or manage its settings
|
19
18
|
# tddium spec # Run the test suite
|
20
19
|
# tddium status # Display information about this suite, and any open dev sessions
|
@@ -29,7 +28,7 @@ require File.expand_path("../tddium/heroku", __FILE__)
|
|
29
28
|
|
30
29
|
class Tddium < Thor
|
31
30
|
include TddiumConstant
|
32
|
-
|
31
|
+
|
33
32
|
desc "account", "View/Manage account information"
|
34
33
|
method_option :environment, :type => :string, :default => nil
|
35
34
|
method_option :email, :type => :string, :default => nil
|
@@ -383,7 +382,7 @@ class Tddium < Thor
|
|
383
382
|
end
|
384
383
|
|
385
384
|
def dependency_version(command)
|
386
|
-
result = `#{command} -v`.
|
385
|
+
result = `#{command} -v`.strip
|
387
386
|
say Text::Process::DEPENDENCY_VERSION % [command, result]
|
388
387
|
result
|
389
388
|
end
|
@@ -398,6 +397,10 @@ class Tddium < Thor
|
|
398
397
|
tddium_client.environment.to_sym
|
399
398
|
end
|
400
399
|
|
400
|
+
def warn(msg='')
|
401
|
+
STDERR.puts("WARNING: #{msg}")
|
402
|
+
end
|
403
|
+
|
401
404
|
def exit_failure(msg='')
|
402
405
|
abort msg
|
403
406
|
end
|
@@ -423,7 +426,6 @@ class Tddium < Thor
|
|
423
426
|
result
|
424
427
|
end
|
425
428
|
|
426
|
-
|
427
429
|
def get_user
|
428
430
|
call_api(:get, Api::Path::USERS, {}, nil, false) rescue nil
|
429
431
|
end
|
@@ -446,7 +448,7 @@ class Tddium < Thor
|
|
446
448
|
end
|
447
449
|
|
448
450
|
def git_repo?
|
449
|
-
unless system("git status
|
451
|
+
unless system("test -d .git || git status > /dev/null 2>&1")
|
450
452
|
message = Text::Error::GIT_NOT_INITIALIZED
|
451
453
|
say message
|
452
454
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -8,3 +8,16 @@ require "tddium"
|
|
8
8
|
require 'rspec'
|
9
9
|
require "fakefs/spec_helpers"
|
10
10
|
require "tddium_client/tddium_spec_helpers"
|
11
|
+
|
12
|
+
require 'ostruct'
|
13
|
+
|
14
|
+
class Open3SpecHelper
|
15
|
+
def self.stubOpen2e(data, ok, block)
|
16
|
+
stdin = StringIO.new
|
17
|
+
output = StringIO.new(data)
|
18
|
+
status = (ok && 0) || 1
|
19
|
+
value = OpenStruct.new(:exitstatus => status, :to_i => status)
|
20
|
+
wait = OpenStruct.new(:value => value)
|
21
|
+
block.call(stdin, output, wait)
|
22
|
+
end
|
23
|
+
end
|
data/spec/tddium_spec.rb
CHANGED
@@ -14,7 +14,7 @@ describe Tddium do
|
|
14
14
|
SAMPLE_API_KEY = "afb12412bdafe124124asfasfabebafeabwbawf1312342erbfasbb"
|
15
15
|
SAMPLE_APP_NAME = "tddelicious"
|
16
16
|
SAMPLE_BRANCH_NAME = "test"
|
17
|
-
SAMPLE_BUNDLER_VERSION = "1.10.10"
|
17
|
+
SAMPLE_BUNDLER_VERSION = "Bundler version 1.10.10"
|
18
18
|
SAMPLE_DATE_TIME = "2011-03-11T08:43:02Z"
|
19
19
|
SAMPLE_EMAIL = "someone@example.com"
|
20
20
|
SAMPLE_FILE_PATH = "./my_user_file.png"
|
@@ -27,7 +27,7 @@ describe Tddium do
|
|
27
27
|
SAMPLE_NEW_PASSWORD = "foobar2"
|
28
28
|
SAMPLE_REPORT_URL = "http://api.tddium.com/1/sessions/1/test_executions/report"
|
29
29
|
SAMPLE_RUBYGEMS_VERSION = "1.3.7"
|
30
|
-
SAMPLE_RUBY_VERSION = "1.8.7"
|
30
|
+
SAMPLE_RUBY_VERSION = "ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10.5.0]"
|
31
31
|
SAMPLE_RECURLY_URL = "https://tddium.recurly.com/account/1"
|
32
32
|
SAMPLE_SESSION_ID = 1
|
33
33
|
SAMPLE_SUITE_ID = 1
|
@@ -117,8 +117,8 @@ describe Tddium do
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
def stub_bundler_version(tddium
|
121
|
-
tddium.stub(:`).with("bundle -v").and_return(
|
120
|
+
def stub_bundler_version(tddium)
|
121
|
+
tddium.stub(:`).with("bundle -v").and_return(SAMPLE_BUNDLER_VERSION)
|
122
122
|
end
|
123
123
|
|
124
124
|
def stub_call_api_response(method, path, *response)
|
@@ -172,6 +172,8 @@ describe Tddium do
|
|
172
172
|
|
173
173
|
def stub_defaults
|
174
174
|
tddium.stub(:say)
|
175
|
+
tddium.stub(:`).and_raise("unstubbed command")
|
176
|
+
tddium.stub(:system).and_raise("unstubbed command")
|
175
177
|
stub_git_branch(tddium)
|
176
178
|
stub_tddium_client
|
177
179
|
stub_git_status(tddium)
|
@@ -189,7 +191,7 @@ describe Tddium do
|
|
189
191
|
end
|
190
192
|
|
191
193
|
def stub_git_config(tddium)
|
192
|
-
tddium.stub(:`).with(
|
194
|
+
tddium.stub(:`).with("git config --get remote.origin.url").and_return(SAMPLE_GIT_REPO_URI)
|
193
195
|
end
|
194
196
|
|
195
197
|
def stub_git_push(tddium, success = true)
|
@@ -201,8 +203,8 @@ describe Tddium do
|
|
201
203
|
tddium.stub(:`).with(/^git remote #{action}/).and_return(git_response)
|
202
204
|
end
|
203
205
|
|
204
|
-
def stub_ruby_version(tddium
|
205
|
-
tddium.stub(:`).with("ruby -v").and_return(
|
206
|
+
def stub_ruby_version(tddium)
|
207
|
+
tddium.stub(:`).with("ruby -v").and_return(SAMPLE_RUBY_VERSION)
|
206
208
|
end
|
207
209
|
|
208
210
|
def stub_rubygems_version(tddium, version = SAMPLE_RUBYGEMS_VERSION)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tddium-preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.15
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Solano Labs
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-28 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|