nanotest 0.9.4 → 0.9.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/lib/nanotest.rb +3 -4
- data/nanotest.gemspec +1 -1
- data/test/test_helper.rb +1 -0
- data/test/test_nanotest.rb +10 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
### Summary
|
5
5
|
|
6
|
-
Extremely
|
7
|
-
the bare
|
6
|
+
Extremely minimal test framework. Perfect for DIY lovers. Nanotest provides
|
7
|
+
the bare minimum needed; for everything else, there's ruby.
|
8
8
|
|
9
9
|
### Install
|
10
10
|
|
data/Rakefile
CHANGED
@@ -34,7 +34,7 @@ desc "Generate YARD Documentation"
|
|
34
34
|
task :yardoc do
|
35
35
|
require 'yard'
|
36
36
|
files = %w( lib/**/*.rb )
|
37
|
-
options = %w( -o doc/yard --readme README.
|
37
|
+
options = %w( -o doc/yard --readme README.md --files LICENSE )
|
38
38
|
YARD::CLI::Yardoc.run *(options + files)
|
39
39
|
end
|
40
40
|
|
data/lib/nanotest.rb
CHANGED
@@ -3,11 +3,10 @@ module Nanotest
|
|
3
3
|
|
4
4
|
@@failures, @@dots = [], []
|
5
5
|
|
6
|
-
def assert(msg=nil, file=nil, line=nil, &block)
|
6
|
+
def assert(msg=nil, file=nil, line=nil, stack=caller, &block)
|
7
7
|
unless block.call
|
8
|
-
|
9
|
-
|
10
|
-
@@failures << "(%s:%0.3d) %s" % [file, line, msg || "assertion failed"]
|
8
|
+
f,l = stack.first.match(/(.*):(\d+)/)[1..2]
|
9
|
+
@@failures << "(%s:%0.3d) %s" % [file || f, line || l, msg || "assertion failed"]
|
11
10
|
@@dots << 'F'
|
12
11
|
else
|
13
12
|
@@dots << '.'
|
data/nanotest.gemspec
CHANGED
data/test/test_helper.rb
CHANGED
data/test/test_nanotest.rb
CHANGED
@@ -76,5 +76,15 @@ class TestNanotest < MiniTest::Unit::TestCase
|
|
76
76
|
test "displays results with no assertions" do
|
77
77
|
assert_empty Nanotest.results.strip
|
78
78
|
end
|
79
|
+
|
80
|
+
test "handles origin lines that contain colons" do
|
81
|
+
stack = ['o:hai:e:20:blah']
|
82
|
+
Nanotest.assert('', nil, nil, stack) { false }
|
83
|
+
assert_equal "(o:hai:e:020) ", Nanotest.failures.last
|
84
|
+
|
85
|
+
stack = ['o:hai:e:20']
|
86
|
+
Nanotest.assert('', nil, nil, stack) { false }
|
87
|
+
assert_equal "(o:hai:e:020) ", Nanotest.failures.last
|
88
|
+
end
|
79
89
|
end
|
80
90
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanotest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.4
|
4
|
+
version: 0.9.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Aumont
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-25 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|