delano-tryouts 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +9 -0
- data/lib/tryouts/cli/run.rb +3 -2
- data/lib/tryouts/drill/context.rb +1 -1
- data/lib/tryouts/drill/response.rb +5 -3
- data/lib/tryouts/drill/sergeant/benchmark.rb +3 -1
- data/lib/tryouts/drill.rb +5 -1
- data/lib/tryouts/tryout.rb +2 -2
- data/lib/tryouts.rb +6 -2
- data/tryouts/01_mixins_tryouts.rb +2 -2
- data/tryouts.gemspec +1 -1
- metadata +1 -1
data/CHANGES.txt
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
TRYOUTS, CHANGES
|
2
2
|
|
3
3
|
|
4
|
+
#### 0.7.4 (2009-06-29) ###############################
|
5
|
+
|
6
|
+
* FIXED: The stash method is now available to :benchmark drills
|
7
|
+
* FIXED: Specifying a single argument to drill with a block now
|
8
|
+
correctly parses the arg as the expected dream output.
|
9
|
+
* CHANGE: Differentiated non-fatal error messages for successful drills
|
10
|
+
* CHANGE: Context sensitive message for LoadErrors in Tryouts#library
|
11
|
+
|
12
|
+
|
4
13
|
#### 0.7.3 (2009-06-27) ###############################
|
5
14
|
|
6
15
|
* ADDED: Display Tryouts group name for runtime errors.
|
data/lib/tryouts/cli/run.rb
CHANGED
@@ -39,7 +39,7 @@ class Run < Drydock::Command
|
|
39
39
|
|
40
40
|
if Tryouts.verbose > 0
|
41
41
|
print "Tryouts #{Tryouts::VERSION} -- "
|
42
|
-
print "#{Tryouts.sysinfo.to_s}
|
42
|
+
print "#{Tryouts.sysinfo.to_s}@#{RUBY_VERSION} -- "
|
43
43
|
puts "#{start.strftime("%Y-%m-%d %H:%M:%S")}"
|
44
44
|
puts
|
45
45
|
end
|
@@ -48,6 +48,7 @@ class Run < Drydock::Command
|
|
48
48
|
|
49
49
|
passed, failed = 0, 0
|
50
50
|
Tryouts.instances.each_pair do |group,tryouts_inst|
|
51
|
+
puts unless group == Tryouts.instances.keys.first
|
51
52
|
puts ' %-79s'.att(:reverse) % group unless Tryouts.verbose < 0
|
52
53
|
puts " #{tryouts_inst.paths.join("\n ")}" if Tryouts.verbose > 0
|
53
54
|
tryouts_inst.tryouts.each_pair do |name,to|
|
@@ -70,7 +71,7 @@ class Run < Drydock::Command
|
|
70
71
|
|
71
72
|
puts '%4s%s: %s' % ['', ex.class, ex.message.to_s.split($/).join($/ + ' '*16)]
|
72
73
|
puts
|
73
|
-
|
74
|
+
|
74
75
|
if [SyntaxError].member? ex.class
|
75
76
|
# don't print anymore.
|
76
77
|
else
|
@@ -2,7 +2,7 @@
|
|
2
2
|
class Tryouts
|
3
3
|
class Tryout
|
4
4
|
|
5
|
-
# All :api
|
5
|
+
# All :api and :benchmark drills are run within this context.
|
6
6
|
# Each Drill is executed in a new instance of this class. That means
|
7
7
|
# instance variables are not carried through, but class variables are.
|
8
8
|
# The before and after blocks are also run in this context.
|
@@ -193,9 +193,11 @@ class Tryouts::Drill
|
|
193
193
|
when nil
|
194
194
|
@output
|
195
195
|
else
|
196
|
-
if @output.nil?
|
197
|
-
|
198
|
-
|
196
|
+
return nil if @output.nil?
|
197
|
+
|
198
|
+
if !dream.format.is_a?(Symbol)
|
199
|
+
"This dream format is not a Symbol: #{dream.format}"
|
200
|
+
elsif @output.respond_to?(dream.format)
|
199
201
|
@output.send(dream.format)
|
200
202
|
else
|
201
203
|
@output
|
data/lib/tryouts/drill.rb
CHANGED
@@ -53,9 +53,13 @@ class Tryouts
|
|
53
53
|
@sergeant = Tryouts::Drill::Sergeant::CLI.new *args
|
54
54
|
when :api
|
55
55
|
default_output = drill.nil? ? args.shift : nil
|
56
|
-
dream_output, format = *(args.size == 1 ? args.first : args.reverse)
|
57
56
|
@sergeant = Tryouts::Drill::Sergeant::API.new default_output
|
58
57
|
unless args.empty?
|
58
|
+
if args.size == 1
|
59
|
+
dream_output, format = args.first, nil
|
60
|
+
else
|
61
|
+
dream_output, format = args[1], args[0]
|
62
|
+
end
|
59
63
|
@dreams << Tryouts::Drill::Dream.new(dream_output, format)
|
60
64
|
end
|
61
65
|
when :benchmark
|
data/lib/tryouts/tryout.rb
CHANGED
@@ -85,8 +85,8 @@ class Tryouts
|
|
85
85
|
success = @drills.select { |d| !d.skip? && d.success? }
|
86
86
|
success.each do |drill,index|
|
87
87
|
next unless drill.has_error?
|
88
|
-
title = ' %-69s ' % ["\"#{drill.name}\""]
|
89
|
-
puts $/, ' ' << title.color(:red)
|
88
|
+
title = ' Non-fatal error in: %-69s ' % ["\"#{drill.name}\""]
|
89
|
+
puts $/, ' ' << title.color(:red)
|
90
90
|
puts drill.report
|
91
91
|
end
|
92
92
|
end
|
data/lib/tryouts.rb
CHANGED
@@ -41,7 +41,7 @@ class Tryouts
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
VERSION = "0.7.
|
44
|
+
VERSION = "0.7.4"
|
45
45
|
|
46
46
|
require 'tryouts/mixins'
|
47
47
|
require 'tryouts/tryout'
|
@@ -154,7 +154,11 @@ class Tryouts
|
|
154
154
|
begin
|
155
155
|
require @library.to_s
|
156
156
|
rescue LoadError => ex
|
157
|
-
|
157
|
+
newex = Tryouts::Exception.new(ex.message)
|
158
|
+
trace = ex.backtrace
|
159
|
+
trace.unshift @paths.last
|
160
|
+
newex.set_backtrace trace
|
161
|
+
@errors << newex
|
158
162
|
Tryouts.failed = true
|
159
163
|
rescue SyntaxError, Exception, TypeError,
|
160
164
|
RuntimeError, NoMethodError, NameError => ex
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
library :tryouts, 'lib'
|
2
2
|
|
3
3
|
group "Mixins"
|
4
4
|
|
@@ -18,6 +18,6 @@ tryouts "Hash", :api do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
drill "knows the deepest point", test_hash.deepest_point, 3
|
21
|
-
drill "has a last method", {}
|
21
|
+
drill "has a last method", {}, :respond_to?, :last
|
22
22
|
|
23
23
|
end
|
data/tryouts.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
@spec = Gem::Specification.new do |s|
|
2
2
|
s.name = "tryouts"
|
3
3
|
s.rubyforge_project = "tryouts"
|
4
|
-
s.version = "0.7.
|
4
|
+
s.version = "0.7.4"
|
5
5
|
s.summary = "Tryouts are high-level tests for your Ruby code. May all your dreams come true!"
|
6
6
|
s.description = s.summary
|
7
7
|
s.author = "Delano Mandelbaum"
|