micro_test 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -2
- data/README.md +12 -1
- data/bin/mt +2 -0
- data/lib/micro_test.rb +7 -4
- data/lib/micro_test/formatters/default.rb +5 -3
- data/lib/micro_test/runner.rb +2 -1
- data/lib/micro_test/version.rb +1 -1
- metadata +4 -3
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MicroTest
|
2
2
|
|
3
|
-
## The Sinatra of testing frameworks
|
3
|
+
## The Sinatra of testing frameworks
|
4
4
|
|
5
5
|
### Quick Start
|
6
6
|
|
@@ -35,4 +35,15 @@ Run
|
|
35
35
|
$ mt
|
36
36
|
```
|
37
37
|
|
38
|
+
Want BDD?
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
class DescribeMyObject < MicroTest::Test
|
42
|
+
test "that a feature does something" do
|
43
|
+
assert true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
|
38
49
|
[See the product page for more details.](http://hopsoft.github.com/micro_test/)
|
data/bin/mt
CHANGED
data/lib/micro_test.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
|
2
|
-
require
|
3
|
-
require
|
4
|
-
|
1
|
+
require "bundler"
|
2
|
+
Bundler.require :default
|
3
|
+
Bundler.require :debug
|
4
|
+
|
5
|
+
path = File.join(File.dirname(__FILE__), "micro_test", "*.rb")
|
6
|
+
Dir[path].each { |file| require file }
|
5
7
|
|
6
8
|
MicroTest::Test.add_observer MicroTest::Runner
|
9
|
+
|
@@ -21,15 +21,17 @@ module MicroTest
|
|
21
21
|
def test(info)
|
22
22
|
@total += 1
|
23
23
|
info[:passed] ? @passed += 1 : @failed += 1
|
24
|
-
|
24
|
+
duration = (info[:duration] * 10**4).round.to_f / 10**4
|
25
|
+
msg = "#{info[:name]} ".ljust(60, ".") + duration.to_s
|
25
26
|
if info[:passed]
|
26
|
-
puts green(:PASS)
|
27
|
+
puts " #{green(:PASS)} #{msg}"
|
27
28
|
else
|
28
29
|
if info[:error]
|
30
|
+
puts msg
|
29
31
|
puts "#{red :ERROR} #{red info[:error].message}"
|
30
32
|
puts " #{red info[:error].backtrace[0]}"
|
31
33
|
else
|
32
|
-
puts red(:FAIL)
|
34
|
+
puts " #{red(:FAIL)} #{msg}"
|
33
35
|
info[:asserts].each do |assert|
|
34
36
|
next if assert[:passed]
|
35
37
|
puts " #{red assert[:line]}"
|
data/lib/micro_test/runner.rb
CHANGED
@@ -52,8 +52,9 @@ module MicroTest
|
|
52
52
|
@failed = false
|
53
53
|
@asserts = []
|
54
54
|
test_class.invoke :before, :each
|
55
|
+
start = Time.now
|
55
56
|
test_class.tests[desc].call
|
56
|
-
formatter.test :name => desc, :passed => !@failed, :asserts => @asserts
|
57
|
+
formatter.test :name => desc, :passed => !@failed, :asserts => @asserts, :duration => Time.now - start
|
57
58
|
test_class.invoke :after, :each
|
58
59
|
end
|
59
60
|
|
data/lib/micro_test/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: micro_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slop
|
@@ -106,8 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 1.8.
|
109
|
+
rubygems_version: 1.8.23
|
110
110
|
signing_key:
|
111
111
|
specification_version: 3
|
112
112
|
summary: The Sinatra of testing frameworks.
|
113
113
|
test_files: []
|
114
|
+
has_rdoc:
|