fakes-rspec 0.3.2 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Fakes
2
2
  module RSpec
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.8"
4
4
  end
5
5
  end
@@ -9,3 +9,8 @@ require 'core/occurances'
9
9
  require 'core/received_occurances_criteria'
10
10
  require 'core/received_criteria'
11
11
 
12
+ RSpec.configure do |config|
13
+ config.after(:each) do
14
+ reset_fake_classes
15
+ end
16
+ end
@@ -101,6 +101,22 @@ describe "using the rspec extensions" do
101
101
  item.should have_received(:hello,matches.any)
102
102
  end
103
103
 
104
+ it "should be able to determing if a call was made using a combination of arg matchers and explicit values" do
105
+ item = fake
106
+ item.hello("Yes",2)
107
+
108
+ item.should have_received(:hello,matches.regex(/Y/),2)
109
+ end
110
+ end
111
+ context "using class swapping" do
112
+ it "should be able to fake out behaviour of singleton methods" do
113
+ fake_class Dir
114
+
115
+ Dir.stub(:exist?).and_return false
116
+
117
+ Dir.exist('/').should be_false
118
+ end
119
+
104
120
  it "should be able to determing if a call was made using a combination of arg matchers and explicit values" do
105
121
  item = fake
106
122
  item.hello("Yes",2)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakes-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-09 00:00:00.000000000 Z
12
+ date: 2012-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake