throat-punch 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +56 -0
- data/Rakefile +40 -0
- data/lib/throat_punch.rb +18 -0
- data/lib/throat_punch/version.rb +13 -0
- data/test/test_helper.rb +6 -0
- data/test/unit/throat_punch_test.rb +23 -0
- metadata +103 -0
data/README.rdoc
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
...was deleted by original author, now its recovered, so ...
|
2
|
+
|
3
|
+
= ThroatPunch
|
4
|
+
|
5
|
+
== Description
|
6
|
+
|
7
|
+
Punch your codes in the throat...
|
8
|
+
|
9
|
+
This library just wraps my preferred testing stack in an easy-to-use gem.
|
10
|
+
|
11
|
+
== Installation
|
12
|
+
|
13
|
+
sudo gem install throat-punch
|
14
|
+
|
15
|
+
== Usage
|
16
|
+
|
17
|
+
require 'rubygems'
|
18
|
+
require 'throat_punch'
|
19
|
+
|
20
|
+
class StringTest < Test::Unit::TestCase
|
21
|
+
|
22
|
+
context "An instance of the String class" do
|
23
|
+
it "should lie about its length" do
|
24
|
+
string = String.new
|
25
|
+
string.expects(:length).with().returns(10)
|
26
|
+
|
27
|
+
string.length.should == 10
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
== License
|
34
|
+
|
35
|
+
Copyright (c) 2008 Patrick Reagan (mailto:reaganpr@gmail.com)
|
36
|
+
|
37
|
+
Permission is hereby granted, free of charge, to any person
|
38
|
+
obtaining a copy of this software and associated documentation
|
39
|
+
files (the "Software"), to deal in the Software without
|
40
|
+
restriction, including without limitation the rights to use,
|
41
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
42
|
+
copies of the Software, and to permit persons to whom the
|
43
|
+
Software is furnished to do so, subject to the following
|
44
|
+
conditions:
|
45
|
+
|
46
|
+
The above copyright notice and this permission notice shall be
|
47
|
+
included in all copies or substantial portions of the Software.
|
48
|
+
|
49
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
50
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
51
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
52
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
53
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
54
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
55
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
56
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake/gempackagetask'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
require 'lib/throat_punch/version'
|
6
|
+
|
7
|
+
task :default => :test
|
8
|
+
|
9
|
+
spec = Gem::Specification.new do |s|
|
10
|
+
s.name = 'throat-punch'
|
11
|
+
s.version = ThroatPunch::Version.to_s
|
12
|
+
s.has_rdoc = true
|
13
|
+
s.extra_rdoc_files = %w(README.rdoc)
|
14
|
+
s.rdoc_options = %w(--main README.rdoc)
|
15
|
+
s.summary = "Punch your codes in the throat..."
|
16
|
+
s.author = 'Patrick Reagan'
|
17
|
+
s.email = 'reaganpr@gmail.com'
|
18
|
+
s.homepage = 'http://sneaq.net'
|
19
|
+
s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,test}/**/*")
|
20
|
+
s.add_dependency('shoulda')
|
21
|
+
s.add_dependency('mhennemeyer-matchy')
|
22
|
+
s.add_dependency('mocha')
|
23
|
+
end
|
24
|
+
|
25
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
26
|
+
pkg.gem_spec = spec
|
27
|
+
end
|
28
|
+
|
29
|
+
Rake::TestTask.new do |t|
|
30
|
+
t.libs << 'test'
|
31
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
32
|
+
t.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'Generate the gemspec to serve this Gem from Github'
|
36
|
+
task :gemspec do
|
37
|
+
file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
|
38
|
+
File.open(file, 'w') {|f| f << spec.to_ruby }
|
39
|
+
puts "Created gemspec: #{file}"
|
40
|
+
end
|
data/lib/throat_punch.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
$:.unshift File.dirname(__FILE__)
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'shoulda'
|
5
|
+
require 'matchy'
|
6
|
+
require 'mocha'
|
7
|
+
|
8
|
+
class Test::Unit::TestCase
|
9
|
+
|
10
|
+
def self.describe(*args, &block) # :nodoc:
|
11
|
+
context(*args, &block)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.it(*args, &block) # :nodoc:
|
15
|
+
should(args, &block)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
|
3
|
+
class ThroatPunchTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
context "An instance of the ThroatPunch class" do
|
6
|
+
|
7
|
+
should "work" do
|
8
|
+
s = ''
|
9
|
+
s.expects(:length).returns(10)
|
10
|
+
s.length.should == 10
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "Other stuff" do
|
16
|
+
|
17
|
+
it "should not fail" do
|
18
|
+
true.should be(true)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: throat-punch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 3
|
9
|
+
version: 0.2.3
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Patrick Reagan
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-12-17 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: shoulda
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: mhennemeyer-matchy
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
version: "0"
|
42
|
+
type: :runtime
|
43
|
+
version_requirements: *id002
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: mocha
|
46
|
+
prerelease: false
|
47
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
type: :runtime
|
55
|
+
version_requirements: *id003
|
56
|
+
description:
|
57
|
+
email: reaganpr@gmail.com
|
58
|
+
executables: []
|
59
|
+
|
60
|
+
extensions: []
|
61
|
+
|
62
|
+
extra_rdoc_files:
|
63
|
+
- README.rdoc
|
64
|
+
files:
|
65
|
+
- README.rdoc
|
66
|
+
- Rakefile
|
67
|
+
- lib/throat_punch/version.rb
|
68
|
+
- lib/throat_punch.rb
|
69
|
+
- test/unit/throat_punch_test.rb
|
70
|
+
- test/test_helper.rb
|
71
|
+
has_rdoc: true
|
72
|
+
homepage: http://sneaq.net
|
73
|
+
licenses: []
|
74
|
+
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options:
|
77
|
+
- --main
|
78
|
+
- README.rdoc
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
95
|
+
requirements: []
|
96
|
+
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 1.3.6
|
99
|
+
signing_key:
|
100
|
+
specification_version: 3
|
101
|
+
summary: Punch your codes in the throat...
|
102
|
+
test_files: []
|
103
|
+
|