bacon-rr 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data/.gemspec +20 -0
  2. data/CHANGELOG.rdoc +2 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.rdoc +19 -0
  5. data/Rakefile +35 -0
  6. data/deps.rip +2 -0
  7. data/lib/bacon/rr.rb +34 -0
  8. metadata +106 -0
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'rubygems' unless Object.const_defined?(:Gem)
3
+ require File.dirname(__FILE__) + "/lib/bacon/rr"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "bacon-rr"
7
+ s.version = Bacon::Rr::VERSION
8
+ s.authors = ["Gabriel Horner"]
9
+ s.email = "gabriel.horner@gmail.com"
10
+ s.homepage = "http://github.com/cldwalker/bacon-rr"
11
+ s.summary = "Simple adapter to bring rr to bacon"
12
+ s.description = "This extends the bacon testing framework with the ability to use rr."
13
+ s.required_rubygems_version = ">= 1.3.6"
14
+ s.rubyforge_project = 'tagaholic'
15
+ s.add_dependency 'bacon', '>= 1.1.0'
16
+ s.add_dependency 'rr', '>= 1.0'
17
+ s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
18
+ s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
19
+ s.license = 'MIT'
20
+ end
@@ -0,0 +1,2 @@
1
+ == 0.1.0
2
+ * Initial release!
@@ -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.
@@ -0,0 +1,19 @@
1
+ == Description
2
+
3
+ This extends the bacon testing framework with the ability to use rr.
4
+
5
+ == Install
6
+
7
+ Install the gem with:
8
+
9
+ sudo gem install bacon-rr
10
+
11
+ == Usage
12
+
13
+ Use in tests with:
14
+
15
+ require 'bacon/rr'
16
+
17
+ == Bugs/Issues
18
+
19
+ Please report them {on github}[http://github.com/cldwalker/bacon-rr/issues].
@@ -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
@@ -0,0 +1,2 @@
1
+ bacon >=1.1.0
2
+ rr >=1.0
@@ -0,0 +1,34 @@
1
+ require 'rr'
2
+ require 'bacon'
3
+
4
+ module Bacon
5
+ module Rr
6
+ VERSION = '0.1.0'
7
+
8
+ RR.trim_backtrace = true
9
+
10
+ def self.included(mod)
11
+ mod.send :include, RR::Adapters::RRMethods
12
+ mod.module_eval %[
13
+ alias_method :old_it, :it
14
+ def it(description, &block)
15
+ old_it(description) do
16
+ begin
17
+ # Add at least one requirement to ensure mock-only tests don't fail
18
+ Bacon::Counter[:requirements] += 1
19
+ yield
20
+ #Bacon::Counter[:requirements] -= 1 if RR.double_injections.size.zero?
21
+ RR.verify
22
+ rescue RR::Errors::RRError=>e
23
+ raise Bacon::Error.new(:failed, e.message)
24
+ ensure
25
+ RR.reset
26
+ end
27
+ end
28
+ end
29
+ ]
30
+ end
31
+ end
32
+ end
33
+
34
+ Bacon::Context.send :include, Bacon::Rr
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bacon-rr
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Gabriel Horner
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-16 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
+ - !ruby/object:Gem::Dependency
38
+ name: rr
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 15
46
+ segments:
47
+ - 1
48
+ - 0
49
+ version: "1.0"
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ description: This extends the bacon testing framework with the ability to use rr.
53
+ email: gabriel.horner@gmail.com
54
+ executables: []
55
+
56
+ extensions: []
57
+
58
+ extra_rdoc_files:
59
+ - README.rdoc
60
+ - LICENSE.txt
61
+ files:
62
+ - lib/bacon/rr.rb
63
+ - LICENSE.txt
64
+ - CHANGELOG.rdoc
65
+ - README.rdoc
66
+ - deps.rip
67
+ - Rakefile
68
+ - .gemspec
69
+ has_rdoc: true
70
+ homepage: http://github.com/cldwalker/bacon-rr
71
+ licenses:
72
+ - MIT
73
+ post_install_message:
74
+ rdoc_options: []
75
+
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 23
93
+ segments:
94
+ - 1
95
+ - 3
96
+ - 6
97
+ version: 1.3.6
98
+ requirements: []
99
+
100
+ rubyforge_project: tagaholic
101
+ rubygems_version: 1.3.7
102
+ signing_key:
103
+ specification_version: 3
104
+ summary: Simple adapter to bring rr to bacon
105
+ test_files: []
106
+