tuff 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in tuff.gemspec
4
+ gemspec
@@ -0,0 +1,30 @@
1
+ ## Tuff
2
+
3
+ Tuff (**T**est **U**nit **F**ast **F**ail) will stop your test suite as soon as a test fails, helping you to fix broken things quickly.
4
+ It's based on a [RSpec feature](http://jeffkreeftmeijer.com/2010/making-rspec-stop-operation-immediately-after-failing/).
5
+
6
+ ## Usage
7
+
8
+ gem install tuff
9
+
10
+ or using Gemfile
11
+
12
+ gem "tuff"
13
+
14
+ ## Usage
15
+
16
+ There is no "usage", just run your tests as always do, Tuff will know when help you.
17
+
18
+ ## Maintainer
19
+
20
+ * Rafael Souza - [rafaelss.com](http://rafaelss.com)
21
+
22
+ ## License
23
+
24
+ (The MIT License)
25
+
26
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
27
+
28
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
29
+
30
+ THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1 @@
1
+ require "tuff/test_suite"
@@ -0,0 +1,19 @@
1
+ require "test/unit/testsuite"
2
+
3
+ module Test
4
+ module Unit
5
+ class TestSuite
6
+
7
+ def run(result, &progress_block)
8
+ yield(STARTED, name)
9
+ run_startup(result)
10
+ @tests.each do |test|
11
+ test.run(result, &progress_block)
12
+ break unless result.passed?
13
+ end
14
+ run_shutdown(result)
15
+ yield(FINISHED, name)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module Tuff
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,40 @@
1
+ require "minitest/autorun"
2
+ require "mocha"
3
+ require "tuff/test_suite"
4
+
5
+ class TestTestSuite < MiniTest::Unit::TestCase
6
+
7
+ def test_run_with_fail_test
8
+ result = mock
9
+ result.expects(:passed?, false)
10
+
11
+ test_1 = mock
12
+ test_1.expects(:run).with(result)
13
+
14
+ test_2 = mock
15
+ test_2.expects(:run).never
16
+
17
+ progress_block = proc { }
18
+
19
+ suite = Test::Unit::TestSuite.new
20
+ suite.instance_variable_set(:@tests, [ test_1, test_2 ])
21
+ suite.run(result, &progress_block)
22
+ end
23
+
24
+ def test_run
25
+ result = MiniTest::Mock.new
26
+ result.expect(:passed?, true)
27
+
28
+ test_1 = mock
29
+ test_1.expects(:run).with(result)
30
+
31
+ test_2 = mock
32
+ test_2.expects(:run).with(result)
33
+
34
+ progress_block = proc { }
35
+
36
+ suite = Test::Unit::TestSuite.new
37
+ suite.instance_variable_set(:@tests, [ test_1, test_2 ])
38
+ suite.run(result, &progress_block)
39
+ end
40
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "tuff/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "tuff"
7
+ s.version = Tuff::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Rafael Souza"]
10
+ s.email = ["me@rafaelss.com"]
11
+ s.homepage = "http://github.com/rafaelss/tuff"
12
+ s.summary = %q{Fast Fail for Test Unit}
13
+ s.description = %q{Gem that adds same fast fail functionality from rspec to test-unit}
14
+
15
+ s.add_runtime_dependency "test-unit"
16
+ s.add_development_dependency "minitest", "~> 2.0.2"
17
+ s.add_development_dependency "mocha", "~> 0.9.10"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tuff
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Rafael Souza
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-30 00:00:00 -02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: test-unit
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :runtime
31
+ prerelease: false
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: minitest
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 2
42
+ - 0
43
+ - 2
44
+ version: 2.0.2
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: mocha
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ - 9
58
+ - 10
59
+ version: 0.9.10
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: *id003
63
+ description: Gem that adds same fast fail functionality from rspec to test-unit
64
+ email:
65
+ - me@rafaelss.com
66
+ executables: []
67
+
68
+ extensions: []
69
+
70
+ extra_rdoc_files: []
71
+
72
+ files:
73
+ - .gitignore
74
+ - Gemfile
75
+ - README.md
76
+ - Rakefile
77
+ - lib/tuff.rb
78
+ - lib/tuff/test_suite.rb
79
+ - lib/tuff/version.rb
80
+ - test/test_test_suite.rb
81
+ - tuff.gemspec
82
+ has_rdoc: true
83
+ homepage: http://github.com/rafaelss/tuff
84
+ licenses: []
85
+
86
+ post_install_message:
87
+ rdoc_options: []
88
+
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ hash: -3241826530320404932
97
+ segments:
98
+ - 0
99
+ version: "0"
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ hash: -3241826530320404932
106
+ segments:
107
+ - 0
108
+ version: "0"
109
+ requirements: []
110
+
111
+ rubyforge_project:
112
+ rubygems_version: 1.3.7
113
+ signing_key:
114
+ specification_version: 3
115
+ summary: Fast Fail for Test Unit
116
+ test_files:
117
+ - test/test_test_suite.rb