micro_test 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -3
- data/bin/mt +1 -1
- data/lib/micro_test/runner.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -10,7 +10,7 @@ MiniTest is a step in the right direction, but still feels bigger than it should
|
|
10
10
|
## Features
|
11
11
|
|
12
12
|
* __Opinionated & small__ - _only 100 lines of code_
|
13
|
-
* __Only one
|
13
|
+
* __Only one assert method: `assert`__ - _since this is the heart of testing_
|
14
14
|
* __Tests run in random order__ - _to prevent the bad practice of run order depenencies_
|
15
15
|
* __Plays nice with others__ - _easy to introduce to an existing codebase_
|
16
16
|
|
@@ -27,7 +27,7 @@ gem install micro_test
|
|
27
27
|
* Setup with `before [:all|:each] do ...`
|
28
28
|
* Teardown with `after [:all|:each] do ...`
|
29
29
|
* Assert statements with `assert [statement]`
|
30
|
-
* Run tests from the terminal with `$
|
30
|
+
* Run tests from the terminal with `$ mt`
|
31
31
|
* Run tests from Ruby with `MicroTest::Runner.run`
|
32
32
|
|
33
33
|
That's all there is to learn.
|
@@ -80,12 +80,24 @@ class MathTest < MicroTest::Test
|
|
80
80
|
end
|
81
81
|
```
|
82
82
|
|
83
|
-
Run the
|
83
|
+
Run all tests in the test dir, relative to the current dir.
|
84
|
+
|
85
|
+
```bash
|
86
|
+
$ mt
|
87
|
+
```
|
88
|
+
|
89
|
+
Run all tests in a directory.
|
84
90
|
|
85
91
|
```bash
|
86
92
|
$ mt /example/test
|
87
93
|
```
|
88
94
|
|
95
|
+
Run all tests in a file.
|
96
|
+
|
97
|
+
```bash
|
98
|
+
$ mt /example/test/math_test.rb
|
99
|
+
```
|
100
|
+
|
89
101
|
Test output.
|
90
102
|
|
91
103
|
![MicroTest output](http://hopsoft.github.com/micro_test/images/micro_test.png)
|
data/bin/mt
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "micro_test"))
|
4
4
|
|
5
5
|
path = ARGV[0].to_s.strip
|
6
|
-
path = Dir.pwd if path.empty?
|
6
|
+
path = File.join(Dir.pwd, "test") if path.empty?
|
7
7
|
|
8
8
|
if path == "-h" || path == "--help"
|
9
9
|
puts "Runs MicroTest on the provided path."
|
data/lib/micro_test/runner.rb
CHANGED
@@ -31,7 +31,7 @@ module MicroTest
|
|
31
31
|
path = callstack_entry[0, callstack_entry.index(/:[0-9]+:/)]
|
32
32
|
file = file(path)
|
33
33
|
line_num = callstack_entry.scan(/:[0-9]+:/).first.gsub(/:/, "").to_i
|
34
|
-
line = file[line_num - 1]
|
34
|
+
line = file[line_num - 1].strip
|
35
35
|
{
|
36
36
|
:path => path,
|
37
37
|
:file => file,
|
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.0.
|
4
|
+
version: 0.0.9
|
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-09-
|
12
|
+
date: 2012-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! ' A tiny testing framework.
|
15
15
|
|