bacon-bits 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemspec +19 -0
- data/CHANGELOG.rdoc +2 -0
- data/LICENSE.txt +22 -0
- data/README.rdoc +21 -0
- data/Rakefile +35 -0
- data/lib/bacon/bits.rb +35 -0
- metadata +90 -0
data/.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'rubygems' unless Object.const_defined?(:Gem)
|
3
|
+
require File.dirname(__FILE__) + "/lib/bacon/bits"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "bacon-bits"
|
7
|
+
s.version = Bacon::Bits::VERSION
|
8
|
+
s.authors = ["Gabriel Horner"]
|
9
|
+
s.email = "gabriel.horner@gmail.com"
|
10
|
+
s.homepage = "http://github.com/cldwalker/bacon-bits"
|
11
|
+
s.summary = "Making bacon a little tastier."
|
12
|
+
s.description = "This extends the bacon testing framework with useful extensions to disable tests, have before and after blocks that run once and more."
|
13
|
+
s.required_rubygems_version = ">= 1.3.6"
|
14
|
+
s.rubyforge_project = 'tagaholic'
|
15
|
+
s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c}]) + %w{Rakefile .gemspec}
|
16
|
+
s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
|
17
|
+
s.add_dependency 'bacon', '>=1.1.0'
|
18
|
+
s.license = 'MIT'
|
19
|
+
end
|
data/CHANGELOG.rdoc
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT LICENSE
|
2
|
+
|
3
|
+
Copyright (c) 2010 Gabriel Horner
|
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.rdoc
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
== Description
|
2
|
+
|
3
|
+
This extends the bacon testing framework with useful extensions to disable tests, have before and after
|
4
|
+
blocks that run once and more. For examples in the wild, see the tests for
|
5
|
+
boson{http://github.com/cldwalker/boson} or bond{http://github.com/cldwalker/bond}.
|
6
|
+
|
7
|
+
== Install
|
8
|
+
|
9
|
+
Install the gem with:
|
10
|
+
|
11
|
+
sudo gem install bacon-bits
|
12
|
+
|
13
|
+
== Usage
|
14
|
+
|
15
|
+
Use in tests with:
|
16
|
+
|
17
|
+
require 'bacon/bits'
|
18
|
+
|
19
|
+
== Bugs/Issues
|
20
|
+
|
21
|
+
Please report them {on github}[http://github.com/cldwalker/bacon-bits/issues].
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
def gemspec
|
5
|
+
@gemspec ||= eval(File.read('.gemspec'), binding, '.gemspec')
|
6
|
+
end
|
7
|
+
|
8
|
+
desc "Build the gem"
|
9
|
+
task :gem=>:gemspec do
|
10
|
+
sh "gem build .gemspec"
|
11
|
+
FileUtils.mkdir_p 'pkg'
|
12
|
+
FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", 'pkg'
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Install the gem locally"
|
16
|
+
task :install => :gem do
|
17
|
+
sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Generate the gemspec"
|
21
|
+
task :generate do
|
22
|
+
puts gemspec.to_ruby
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Validate the gemspec"
|
26
|
+
task :gemspec do
|
27
|
+
gemspec.validate
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Run tests'
|
31
|
+
task :test do |t|
|
32
|
+
sh 'bacon -q -Ilib -I. test/*_test.rb'
|
33
|
+
end
|
34
|
+
|
35
|
+
task :default => :test
|
data/lib/bacon/bits.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'bacon'
|
2
|
+
|
3
|
+
module Bacon
|
4
|
+
module Bits
|
5
|
+
VERSION = '0.0.1'
|
6
|
+
|
7
|
+
# Will remove this once the latest bacon (which contains this) is released as a gem
|
8
|
+
def self.included(mod)
|
9
|
+
mod.module_eval do
|
10
|
+
# nested context methods automatically inherit methods from parent contexts
|
11
|
+
def describe(*args, &block)
|
12
|
+
context = Bacon::Context.new(args.join(' '), &block)
|
13
|
+
(parent_context = self).methods(false).each {|e|
|
14
|
+
class<<context; self end.send(:define_method, e) {|*args| parent_context.send(e, *args)}
|
15
|
+
}
|
16
|
+
@before.each { |b| context.before(&b) }
|
17
|
+
@after.each { |b| context.after(&b) }
|
18
|
+
context.run
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def xit(*args); end
|
24
|
+
def xdescribe(*args); end
|
25
|
+
def before_all; yield; end
|
26
|
+
def after_all; yield; end
|
27
|
+
def assert(description, &block)
|
28
|
+
it(description) do
|
29
|
+
block.call.should == true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Bacon::Context.send :include, Bacon::Bits
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bacon-bits
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Gabriel Horner
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-07-15 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: bacon
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 19
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 1
|
33
|
+
- 0
|
34
|
+
version: 1.1.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
description: This extends the bacon testing framework with useful extensions to disable tests, have before and after blocks that run once and more.
|
38
|
+
email: gabriel.horner@gmail.com
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files:
|
44
|
+
- README.rdoc
|
45
|
+
- LICENSE.txt
|
46
|
+
files:
|
47
|
+
- lib/bacon/bits.rb
|
48
|
+
- LICENSE.txt
|
49
|
+
- CHANGELOG.rdoc
|
50
|
+
- README.rdoc
|
51
|
+
- Rakefile
|
52
|
+
- .gemspec
|
53
|
+
has_rdoc: true
|
54
|
+
homepage: http://github.com/cldwalker/bacon-bits
|
55
|
+
licenses:
|
56
|
+
- MIT
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
hash: 3
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
version: "0"
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 23
|
77
|
+
segments:
|
78
|
+
- 1
|
79
|
+
- 3
|
80
|
+
- 6
|
81
|
+
version: 1.3.6
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project: tagaholic
|
85
|
+
rubygems_version: 1.3.7
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: Making bacon a little tastier.
|
89
|
+
test_files: []
|
90
|
+
|