cutest-cj 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cutest.rb +9 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88f48ff40fc449bbb26e705c04a23abdedde6ffd
|
4
|
+
data.tar.gz: 8bd1a02a25192c32c686d56ec8d0bc7251f760e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e6d7f9525e17aadcfa67ea980275db3de98e140ee4aeaf8d0e9dab90030049ca22048358710f5c65fe4228f721ab4e565209784363930940e546b742157cb9
|
7
|
+
data.tar.gz: e1f855ef47eca8b08419bfd28399959fe8611010658658d82dc454078a07ad0c5a4c0d4330184838766f15432bb962a5d26ca6863b705e082d313db13f6c49aa
|
data/lib/cutest.rb
CHANGED
@@ -5,7 +5,7 @@ class Cutest
|
|
5
5
|
autoload :Database, 'database'
|
6
6
|
|
7
7
|
unless defined?(VERSION)
|
8
|
-
VERSION = "1.3.
|
8
|
+
VERSION = "1.3.5"
|
9
9
|
FILTER = %r[/(ruby|jruby|rbx)[-/]([0-9\.])+]
|
10
10
|
CACHE = Hash.new { |h, k| h[k] = File.readlines(k) }
|
11
11
|
end
|
@@ -155,8 +155,6 @@ module Kernel
|
|
155
155
|
# Create a class where the block will be evaluated. Recommended to improve
|
156
156
|
# isolation between tests.
|
157
157
|
def scope(name = nil, &block)
|
158
|
-
cutest[:current_scope] = name
|
159
|
-
|
160
158
|
if !cutest[:scope] || cutest[:scope] == name
|
161
159
|
puts "\033[93mScope: \033[0m#{cutest[:scope]}"
|
162
160
|
puts ""
|
@@ -204,17 +202,15 @@ module Kernel
|
|
204
202
|
def test(name = nil, &block)
|
205
203
|
cutest[:test] = name
|
206
204
|
|
207
|
-
if !cutest[:
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
block.call(setup && setup.call)
|
213
|
-
end
|
214
|
-
puts ''
|
215
|
-
puts " \033[93mTest: \033[0m#{cutest[:test]} \033[32m✔\033[0m"
|
216
|
-
puts "\e[94m#{time_taken}\033[0m"
|
205
|
+
if !cutest[:only] || cutest[:only] == name
|
206
|
+
print ' '
|
207
|
+
time_taken = Benchmark.measure do
|
208
|
+
prepare.each { |blk| blk.call }
|
209
|
+
block.call(setup && setup.call)
|
217
210
|
end
|
211
|
+
puts ''
|
212
|
+
puts " \033[93mTest: \033[0m#{cutest[:test]} \033[32m✔\033[0m"
|
213
|
+
puts "\e[94m#{time_taken}\033[0m"
|
218
214
|
end
|
219
215
|
|
220
216
|
cutest[:test] = nil
|