micro_test 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/bin/mt CHANGED
@@ -40,12 +40,12 @@ parser = OptionParser.new do |opts|
40
40
 
41
41
  opts.on("-v", "--version", "Show version.") do
42
42
  puts "MicroTest #{MicroTest::VERSION}"
43
- exit
43
+ exit 0
44
44
  end
45
45
 
46
46
  opts.on_tail("-h", "--help", "Show this message.") do
47
47
  puts opts
48
- exit
48
+ exit 0
49
49
  end
50
50
 
51
51
  end
@@ -82,7 +82,7 @@ path = File.join(Dir.pwd, path) unless path =~ /^\//
82
82
  unless File.exist?(path)
83
83
  puts "#{path} not found."
84
84
  puts "Please check the path and try again."
85
- exit
85
+ exit 1
86
86
  end
87
87
  if path =~ /\.rb$/
88
88
  require path
@@ -100,7 +100,7 @@ end
100
100
  unless File.exist?(path)
101
101
  puts "Formatter not found at #{path}"
102
102
  puts "Please check the formatter name and try again."
103
- exit
103
+ exit 1
104
104
  end
105
105
  begin
106
106
  require path
@@ -108,7 +108,7 @@ begin
108
108
  rescue Exception => ex
109
109
  puts "Failed to load the formatter defined at #{path}"
110
110
  puts ex.message
111
- exit
111
+ exit 1
112
112
  end
113
113
 
114
114
  # setup the test runner -------------------------------------------------------
@@ -121,9 +121,11 @@ if options[:pry]
121
121
  require "pry"
122
122
  require "pry-stack_explorer"
123
123
  rescue Exception => e
124
- puts red("Unable to require pry or pry-stack_explorer!")
125
- puts yellow("Be sure to add these gems to your Gemfile and bundle if you are using Bundler.")
126
- exit
124
+ puts red(e.message)
125
+ puts e.backtrace.join("\n")
126
+ puts red("This can be caused when pry-stack_explorer & pry get out of sync.")
127
+ puts red("Try uninstalling the most recent version of pry.")
128
+ exit 1
127
129
  end
128
130
 
129
131
  Pry.config.hooks.add_hook :before_session, :print_instructions do |_, _, _pry_|
@@ -152,6 +154,7 @@ if options[:pry]
152
154
  puts " Type #{yellow "line"} to see the line that failed"
153
155
  puts " #{blue "whereami 10"} for more context"
154
156
  puts " #{blue "edit-method"} to make the fix"
157
+ puts " If #{yellow "line"} doesn't work for you, try #{yellow "up"} & #{yellow "down"} to navigate the stack."
155
158
  puts
156
159
  puts " Type #{yellow "exit"} or #{blue "<CTL-D>"} to continue"
157
160
  puts "".ljust(80, "-")
@@ -159,4 +162,4 @@ if options[:pry]
159
162
  end
160
163
  end
161
164
 
162
- runner.run
165
+ exit runner.run
@@ -42,6 +42,7 @@ module MicroTest
42
42
  @failed = tests.select{ |test| !test.passed? }.count
43
43
  formatter.after_results(self)
44
44
  formatter.after_suite(test_classes)
45
+ @failed
45
46
  end
46
47
 
47
48
  def reset
@@ -1,3 +1,3 @@
1
1
  module MicroTest
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
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.3.5
4
+ version: 0.3.6
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: 2013-01-09 00:00:00.000000000 Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: os
@@ -27,10 +27,24 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
- description: ! " The Sinatra of testing frameworks.\n\n Give MicroTest a try
31
- and discover the following.\n\n * simplicity - a tiny API with only 4 methods\n
32
- \ * pry integration - debugging tests is a cinch\n * asynchronous - faster
33
- multithreaded test runs\n\n Happy testing.\n"
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: The Sinatra of testing frameworks. Its also known as microtest, micro
47
+ test, & micro_test.
34
48
  email:
35
49
  - natehop@gmail.com
36
50
  executables:
@@ -60,8 +74,6 @@ files:
60
74
  - test/runner_test.rb
61
75
  - test/test_test.rb
62
76
  - test/test_wrapper_test.rb
63
- - LICENSE.txt
64
- - README.md
65
77
  homepage: http://hopsoft.github.com/micro_test/
66
78
  licenses:
67
79
  - MIT
@@ -83,10 +95,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
95
  version: '0'
84
96
  requirements: []
85
97
  rubyforge_project:
86
- rubygems_version: 1.8.24
98
+ rubygems_version: 1.8.23
87
99
  signing_key:
88
100
  specification_version: 3
89
- summary: MicroTest is Ruby's no-nonsense testing framework. Its also known as microtest,
90
- micro test, & micro_test.
91
- test_files: []
101
+ summary: The Sinatra of testing frameworks. Its also known as microtest, micro test,
102
+ & micro_test.
103
+ test_files:
104
+ - test/color_test.rb
105
+ - test/cpu_latency_test.rb
106
+ - test/fail_test.rb
107
+ - test/io_latency_test.rb
108
+ - test/runner_test.rb
109
+ - test/test_test.rb
110
+ - test/test_wrapper_test.rb
92
111
  has_rdoc:
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2012 Nathan Hopkins
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,108 +0,0 @@
1
- # MicroTest
2
-
3
- ## The Sinatra of testing frameworks
4
-
5
- Testing frameworks often lose their focus and become an end unto themselves.
6
- MicroTest avoids this pitfall with a relentless focus on simplicity.
7
-
8
- ### Here's what MicroTest brings to the table
9
-
10
- * A simple test API/interface
11
- * An awesome test + dev workflow using Pry
12
- * Fast asynchronous test runs
13
-
14
- ## The Interface
15
-
16
- Everything you need to know about MicroTest's API is outlined here.
17
-
18
- Its simple by design.
19
-
20
- <table>
21
- <tr>
22
- <td><strong><code>MicroTest::Test</code></strong></td>
23
- <td>Superclass for all test classes.</td>
24
- </tr>
25
- <tr>
26
- <td><strong><code>test(desc, &block)</code></strong></td>
27
- <td>
28
- Defines a test method.
29
- <ul>
30
- <li><sr<code>desc</code> - a description of what is being tested</li>
31
- <li><code>block</code> - a block of code which defines the test</li>
32
- </ul>
33
- </td>
34
- </tr>
35
- <tr>
36
- <td><strong><code>assert(value)</code></strong></td>
37
- <td>
38
- Verifies the truthiness of a value.
39
- <ul>
40
- <li><code>value</code> - the value to assert</li>
41
- </ul>
42
- </td>
43
- </tr>
44
- <tr>
45
- <td><strong><code>before(&block)</code></strong></td>
46
- <td>
47
- A callback that runs before each test method.
48
- <ul>
49
- <li><code>&block</code> - the block of code to execute</li>
50
- </ul>
51
- </td>
52
- </tr>
53
- <tr>
54
- <td><strong><code>after(&block)</code></strong></td>
55
- <td>
56
- A callback that runs after each test method.
57
- <ul>
58
- <li><code>&block</code> - the block of code to execute</li>
59
- </ul>
60
- </td>
61
- </tr>
62
- </table>
63
-
64
- ## A Full Example
65
-
66
- The entire public interface is used in this basic example.
67
-
68
- ```ruby
69
- class MathTest < MicroTest::Test
70
-
71
- before do
72
- # runs before each test method
73
- end
74
-
75
- after do
76
- # runs after each test method
77
- end
78
-
79
- test "basic addition" do
80
- assert 2 + 2 == 4
81
- end
82
-
83
- end
84
- ```
85
-
86
- ## Get Started
87
-
88
- MicroTest ships with a demo so you can kick the tires.
89
-
90
- * Install `$ gem install micro_test`
91
- * Help `$ mt --help`
92
- * Demo `$ mt --demo`
93
-
94
- Try some of the more advanced features.
95
-
96
- * Pry workflow `$ mt --demo --pry`
97
- * Async test run `$ mt --demo --async`
98
-
99
- MicroTest is small & unobtrusive. It can run parallel with other test frameworks,
100
- and can be introduced to existing projects with minimal effort.
101
-
102
- ## Advanced
103
-
104
- [See the wiki](https://github.com/hopsoft/micro_test/wiki) to troubleshoot or dig into more advanced topics.
105
-
106
- *Be sure to checkout [MicroMock](https://github.com/hopsoft/micro_mock) for a lightweight mocking solution.*
107
-
108
- Start testing today!