baconmocha 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.markdown +20 -0
  2. data/Rakefile +22 -0
  3. data/lib/baconmocha.rb +26 -0
  4. data/spec/spec.rb +9 -0
  5. metadata +79 -0
data/README.markdown ADDED
@@ -0,0 +1,20 @@
1
+ Bacon Mocha
2
+ ===========
3
+
4
+ Gluing Bacon and Mocha together since... 2009.
5
+
6
+ Also, a serious runner for the Lack of Creativity Ruby Libraries
7
+ Award, together with file-tail and todo.
8
+
9
+
10
+ Usage
11
+ -----
12
+
13
+ Just require 'baconmocha' and use both like you tried to
14
+ before googling for a solution for all the annoyances.
15
+
16
+
17
+ Contributors
18
+ ------------
19
+
20
+ [Pedro Belo](http://twitter.com/ped)
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ desc 'Run specs'
2
+ task :spec do
3
+ sh 'bacon -q spec/spec.rb'
4
+ end
5
+ task :default => :spec
6
+
7
+ begin
8
+ require 'jeweler'
9
+ Jeweler::Tasks.new do |s|
10
+ s.name = "baconmocha"
11
+ s.summary = "Gluing Bacon and Mocha since... 2009"
12
+ s.email = "pedrobelo@gmail.com"
13
+ s.homepage = "http://github.com/pedro/baconmocha"
14
+ s.description = "Also, a serious runner for the Lack of Creativity Ruby Libraries
15
+ Award, together with file-tail and todo"
16
+ s.authors = ["Pedro Belo"]
17
+ s.add_dependency 'bacon'
18
+ s.add_dependency 'mocha'
19
+ end
20
+ rescue LoadError
21
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
22
+ end
data/lib/baconmocha.rb ADDED
@@ -0,0 +1,26 @@
1
+ require 'bacon'
2
+ require 'mocha_standalone'
3
+
4
+ class Mocha::Expectation
5
+ alias :initialize_without_bacon :initialize
6
+ def initialize(*args)
7
+ Bacon::Counter[:requirements] += 1
8
+ initialize_without_bacon(*args)
9
+ end
10
+ end
11
+
12
+ class Bacon::Context
13
+ include Mocha::API
14
+
15
+ def initialize(name, &block)
16
+ @name = name
17
+ @before, @after = [
18
+ [lambda { mocha_setup }],
19
+ [lambda { mocha_verify ; mocha_teardown }]
20
+ ]
21
+ @block = block
22
+ end
23
+
24
+ def xit(desc, &bk)
25
+ end
26
+ end
data/spec/spec.rb ADDED
@@ -0,0 +1,9 @@
1
+ require "#{File.dirname(__FILE__)}/../lib/baconmocha"
2
+
3
+ describe 'Bacon and Mocha used to suck together' do
4
+ it "should not raise empty specification when you use Mocha, not Bacon, to assert something" do
5
+ str = 'a'
6
+ str.expects(:size)
7
+ str.size
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: baconmocha
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Pedro Belo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-14 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: bacon
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: mocha
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: |-
36
+ Also, a serious runner for the Lack of Creativity Ruby Libraries
37
+ Award, together with file-tail and todo
38
+ email: pedrobelo@gmail.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - README.markdown
45
+ files:
46
+ - README.markdown
47
+ - Rakefile
48
+ - lib/baconmocha.rb
49
+ - spec/spec.rb
50
+ has_rdoc: true
51
+ homepage: http://github.com/pedro/baconmocha
52
+ licenses: []
53
+
54
+ post_install_message:
55
+ rdoc_options:
56
+ - --charset=UTF-8
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ requirements: []
72
+
73
+ rubyforge_project:
74
+ rubygems_version: 1.3.4
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: Gluing Bacon and Mocha since... 2009
78
+ test_files:
79
+ - spec/spec.rb