nanotest 0.9.4 → 0.9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
 
4
4
  ### Summary
5
5
 
6
- Extremely mynymal test framework. Perfect for DIY lovers. Nanotest provides
7
- the bare mynymum needed; for everything else, there's ruby.
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.rdoc --files LICENSE )
37
+ options = %w( -o doc/yard --readme README.md --files LICENSE )
38
38
  YARD::CLI::Yardoc.run *(options + files)
39
39
  end
40
40
 
@@ -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
- file ||= caller.first.split(':')[0]
9
- line ||= caller.first.split(':')[1]
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 << '.'
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.rubyforge_project = "nanotest"
9
9
  s.has_rdoc = false
10
10
  s.require_path = "lib"
11
- s.version = "0.9.4"
11
+ s.version = "0.9.4.1"
12
12
  s.files = File.read("Manifest").strip.split("\n")
13
13
 
14
14
  s.add_development_dependency 'minitest'
@@ -3,6 +3,7 @@ require 'nanotest'
3
3
  begin
4
4
  require 'redgreen'
5
5
  require 'phocus'
6
+ require 'ruby-debug'
6
7
  rescue LoadError, RuntimeError
7
8
  end
8
9
 
@@ -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-07 00:00:00 -03:00
12
+ date: 2009-12-25 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency