test-unit-power_assert 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 781d13728d229c93a474c7d8b01c18f11fd7ba51
4
+ data.tar.gz: 3447b6f5c7b5fea606648e38ac2d1ce0ccb6adf4
5
+ SHA512:
6
+ metadata.gz: a8cfe5316ca44d2ddd6097aaf561b911c700599fe14b7e3e0f14666ce37871d2aa8d7a85fff0a82f12b8fecb5f730536957a3f37dee42ef580d5675e9acaa7cc
7
+ data.tar.gz: fbff2784be4fc583556a2e6172740b92c4235772039d892163034df19b34662c22085b619e576ad40e3311aac036852f7d80f5c3fdb286b8b021f060fcff23cc
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .bundle
2
+ Gemfile.lock
3
+ pkg/*
4
+ vendor/*
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.1
5
+ - ruby-head
data/BSDL ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (C) 2014 Kazuki Tsujimoto, All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
data/COPYING ADDED
@@ -0,0 +1,57 @@
1
+ Copyright (C) 2014 Kazuki Tsujimoto, All rights reserved.
2
+
3
+ You can redistribute it and/or modify it under either the terms of the
4
+ 2-clause BSDL (see the file BSDL), or the conditions below:
5
+
6
+ 1. You may make and give away verbatim copies of the source form of the
7
+ software without restriction, provided that you duplicate all of the
8
+ original copyright notices and associated disclaimers.
9
+
10
+ 2. You may modify your copy of the software in any way, provided that
11
+ you do at least ONE of the following:
12
+
13
+ a) place your modifications in the Public Domain or otherwise
14
+ make them Freely Available, such as by posting said
15
+ modifications to Usenet or an equivalent medium, or by allowing
16
+ the author to include your modifications in the software.
17
+
18
+ b) use the modified software only within your corporation or
19
+ organization.
20
+
21
+ c) give non-standard binaries non-standard names, with
22
+ instructions on where to get the original software distribution.
23
+
24
+ d) make other distribution arrangements with the author.
25
+
26
+ 3. You may distribute the software in object code or binary form,
27
+ provided that you do at least ONE of the following:
28
+
29
+ a) distribute the binaries and library files of the software,
30
+ together with instructions (in the manual page or equivalent)
31
+ on where to get the original distribution.
32
+
33
+ b) accompany the distribution with the machine-readable source of
34
+ the software.
35
+
36
+ c) give non-standard binaries non-standard names, with
37
+ instructions on where to get the original software distribution.
38
+
39
+ d) make other distribution arrangements with the author.
40
+
41
+ 4. You may modify and include the part of the software into any other
42
+ software (possibly commercial). But some files in the distribution
43
+ are not written by the author, so that they are not under these terms.
44
+
45
+ For the list of those files and their copying conditions, see the
46
+ file LEGAL.
47
+
48
+ 5. The scripts and library files supplied as input to or produced as
49
+ output from the software do not automatically fall under the
50
+ copyright of the software, but belong to whomever generated them,
51
+ and may be sold commercially, and may be aggregated with this
52
+ software.
53
+
54
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
55
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
56
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
57
+ PURPOSE.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/README.rdoc ADDED
@@ -0,0 +1,43 @@
1
+ = test-unit-power_assert
2
+ == About
3
+ Power Assert for test-unit.
4
+
5
+ == Installation
6
+ $ gem install test-unit-power_assert
7
+
8
+ or
9
+
10
+ $ gem install bundler (if you need)
11
+ $ echo "source 'http://rubygems.org'" > Gemfile
12
+ $ echo "gem 'power_assert', :git => 'git://github.com/k-tsj/power_assert.git'" >> Gemfile
13
+ $ echo "gem 'test-unit-power_assert', :git => 'git://github.com/k-tsj/test-unit-power_assert.git'" >> Gemfile
14
+ $ bundle install --path vendor/bundle
15
+
16
+ == Basic Usage
17
+ === Test Code
18
+
19
+ require 'test/unit'
20
+ require 'test/unit/power_assert'
21
+ class MyTest < Test::Unit::TestCase
22
+ def test_failed
23
+ power_assert do
24
+ "0".class == "3".to_i.times.map {|i| i + 1 }.class
25
+ end
26
+ end
27
+ end
28
+
29
+ Note: It is recommended to require test/unit/power_assert before _loading_ test code.
30
+
31
+ === Result
32
+ Failure:
33
+
34
+ "0".class == "3".to_i.times.map {|i| i + 1 }.class
35
+ | | | | |
36
+ | | | | Array
37
+ | | | [1, 2, 3]
38
+ | | #<Enumerator: 3:times>
39
+ | 3
40
+ String
41
+ test_failed(MyTest)
42
+
43
+ == Travis Build Status {<img src="https://secure.travis-ci.org/k-tsj/test-unit-power_assert.png"/>}[http://travis-ci.org/k-tsj/test-unit-power_assert]
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require "rake/testtask"
4
+ task :default => :test
5
+ Rake::TestTask.new do |t|
6
+ t.test_files = FileList["test/helper.rb", "test/test_*.rb"]
7
+ end
@@ -0,0 +1,30 @@
1
+ # power_assert.rb
2
+ #
3
+ # Copyright (C) 2014 Kazuki Tsujimoto, All rights reserved.
4
+
5
+ require 'test/unit/power_assert/version'
6
+
7
+ require 'test/unit'
8
+ require 'power_assert'
9
+
10
+ module Test::Unit
11
+ module PowerAssert
12
+ module Assertions
13
+ def power_assert(&blk)
14
+ ::PowerAssert.start(blk, assertion_method: __method__) do |pa|
15
+ prc = pa.message_proc
16
+ class << prc
17
+ alias to_s call
18
+ end
19
+ assert_block(prc) do
20
+ pa.yield
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ class TestCase
28
+ include PowerAssert::Assertions
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ module Test
2
+ module Unit
3
+ module PowerAssert
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,22 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+ require 'test/unit/power_assert/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'test-unit-power_assert'
6
+ s.version = Test::Unit::PowerAssert::VERSION
7
+ s.authors = ['Kazuki Tsujimoto']
8
+ s.email = ['kazuki@callcc.net']
9
+ s.homepage = 'https://github.com/k-tsj/test-unit-power_assert'
10
+ s.summary = %q{Power Assert for test-unit}
11
+ s.description = %q{Power Assert for test-unit}
12
+
13
+ s.files = `git ls-files`.split("\n")
14
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f) }
16
+ s.require_paths = ['lib']
17
+ s.add_runtime_dependency 'test-unit'
18
+ s.add_runtime_dependency 'power_assert'
19
+ s.add_development_dependency 'rake'
20
+ s.extra_rdoc_files = ['README.rdoc']
21
+ s.rdoc_options = ['--main', 'README.rdoc']
22
+ end
data/test/helper.rb ADDED
@@ -0,0 +1 @@
1
+ require 'test/unit/power_assert'
@@ -0,0 +1,17 @@
1
+ require 'test/unit'
2
+ require 'test/unit/power_assert'
3
+
4
+ class TestPowerAssert < Test::Unit::TestCase
5
+ def test_successful
6
+ power_assert do
7
+ true
8
+ end
9
+ end
10
+
11
+ def test_failed
12
+ return unless ENV['DEMO']
13
+ power_assert do
14
+ "0".class == "3".to_i.times.map {|i| i + 1 }.class
15
+ end
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: test-unit-power_assert
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kazuki Tsujimoto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: test-unit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: power_assert
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Power Assert for test-unit
56
+ email:
57
+ - kazuki@callcc.net
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files:
61
+ - README.rdoc
62
+ files:
63
+ - ".gitignore"
64
+ - ".travis.yml"
65
+ - BSDL
66
+ - COPYING
67
+ - Gemfile
68
+ - README.rdoc
69
+ - Rakefile
70
+ - lib/test/unit/power_assert.rb
71
+ - lib/test/unit/power_assert/version.rb
72
+ - test-unit-power_assert.gemspec
73
+ - test/helper.rb
74
+ - test/test_power_assert.rb
75
+ homepage: https://github.com/k-tsj/test-unit-power_assert
76
+ licenses: []
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options:
80
+ - "--main"
81
+ - README.rdoc
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.2.2
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Power Assert for test-unit
100
+ test_files: []