better_receive 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module BetterReceive
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -2,7 +2,8 @@ require "better_receive/version"
2
2
 
3
3
  module BetterReceive
4
4
  def better_receive(method_name, *args, &block)
5
- self.respond_to?(method_name).should == true
5
+ self.should RSpec::Matchers::BuiltIn::RespondTo.new(method_name)
6
+
6
7
  self.should_receive(method_name, *args, &block)
7
8
  end
8
9
  end
@@ -18,10 +18,11 @@ describe BetterReceive do
18
18
  end
19
19
 
20
20
  it "raises an error if it the method is not defined" do
21
- foo.should_receive(:respond_to?).with(:baz).and_call_original
22
21
  expect {
23
- foo.better_receive(:baz)
24
- }.to raise_error RSpec::Expectations::ExpectationNotMetError
22
+ foo.better_receive(:bar_baz)
23
+ }.to raise_error(RSpec::Expectations::ExpectationNotMetError) { |error|
24
+ error.message.should =~ /to respond to :bar_baz/
25
+ }
25
26
  end
26
27
 
27
28
  it "checks that the object receives the specified method" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: better_receive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: