testquest 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/testquest.rb +17 -2
- data/test/test_testquest.rb +13 -0
- data/testquest.gemspec +3 -3
- metadata +4 -4
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ begin
|
|
8
8
|
gem.summary = "Run tests, achieve greatness!"
|
9
9
|
gem.description = "When you run your tests, you should be rewarded. Here's your reward."
|
10
10
|
gem.email = "chris@outside.in"
|
11
|
-
gem.homepage = "http://github.com/
|
11
|
+
gem.homepage = "http://tie-rack.github.com/testquest/"
|
12
12
|
gem.authors = ["Chris Shea"]
|
13
13
|
gem.rubyforge_project = "testquest"
|
14
14
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/testquest.rb
CHANGED
@@ -18,7 +18,7 @@ class TestQuest
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
attr_reader :tests, :assertions, :failures, :errors
|
21
|
+
attr_reader :tests, :assertions, :failures, :errors, :time
|
22
22
|
|
23
23
|
def initialize
|
24
24
|
load_questfile
|
@@ -30,7 +30,8 @@ class TestQuest
|
|
30
30
|
def collect_results
|
31
31
|
results = `rake test`
|
32
32
|
@tests, @assertions, @failures, @errors = results.match(RESULT_EXTRACTOR).captures.map {|d| d.to_i}
|
33
|
-
@
|
33
|
+
@time = results.match(/(\d+(?:\.\d+)?) seconds/)[1].to_f
|
34
|
+
@quest_state['runs'] << {'tests' => tests, 'assertions' => assertions, 'failures' => failures, 'errors' => errors, 'time' => time}
|
34
35
|
end
|
35
36
|
|
36
37
|
def output_results
|
@@ -69,6 +70,20 @@ class TestQuest
|
|
69
70
|
celebrate('Success', 'Your tests pass!')
|
70
71
|
end
|
71
72
|
end
|
73
|
+
|
74
|
+
unless achieved?('Slow Road to Awesometown')
|
75
|
+
if last_run['time'] >= 60
|
76
|
+
celebrate('Slow Road to Awesometown', 'Your tests are SLOOOOOOOOOOOW')
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
if @quest_state['runs'].size > 1
|
82
|
+
unless achieved?('Test Frenzy')
|
83
|
+
if last_run['tests'] - @quest_state['runs'][-2]['tests'] > 9
|
84
|
+
celebrate('Test Frenzy', 'Adding tests like a crazy person')
|
85
|
+
end
|
86
|
+
end
|
72
87
|
end
|
73
88
|
end
|
74
89
|
|
data/test/test_testquest.rb
CHANGED
@@ -4,4 +4,17 @@ class TestTestquest < Test::Unit::TestCase
|
|
4
4
|
def test_testquest_exists
|
5
5
|
assert(defined?(TestQuest))
|
6
6
|
end
|
7
|
+
|
8
|
+
# Uncomment this for the Test Frenzy achievement
|
9
|
+
# 10.times do |i|
|
10
|
+
# define_method("test_#{i}_test") do
|
11
|
+
# assert(true)
|
12
|
+
# end
|
13
|
+
# end
|
14
|
+
|
15
|
+
# Uncomment this for Slow Road...
|
16
|
+
# def test_slow
|
17
|
+
# sleep(61)
|
18
|
+
# end
|
7
19
|
end
|
20
|
+
|
data/testquest.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{testquest}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Chris Shea"]
|
12
|
-
s.date = %q{2010-11-
|
12
|
+
s.date = %q{2010-11-13}
|
13
13
|
s.default_executable = %q{testquest}
|
14
14
|
s.description = %q{When you run your tests, you should be rewarded. Here's your reward.}
|
15
15
|
s.email = %q{chris@outside.in}
|
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
"test/test_testquest.rb",
|
39
39
|
"testquest.gemspec"
|
40
40
|
]
|
41
|
-
s.homepage = %q{http://github.com/
|
41
|
+
s.homepage = %q{http://tie-rack.github.com/testquest/}
|
42
42
|
s.rdoc_options = ["--charset=UTF-8"]
|
43
43
|
s.require_paths = ["lib"]
|
44
44
|
s.rubyforge_project = %q{testquest}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Chris Shea
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-13 00:00:00 -05:00
|
18
18
|
default_executable: testquest
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -47,7 +47,7 @@ files:
|
|
47
47
|
- test/test_testquest.rb
|
48
48
|
- testquest.gemspec
|
49
49
|
has_rdoc: true
|
50
|
-
homepage: http://github.com/
|
50
|
+
homepage: http://tie-rack.github.com/testquest/
|
51
51
|
licenses: []
|
52
52
|
|
53
53
|
post_install_message:
|