stubborn 0.1.3 → 0.1.4

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.
data/README.rdoc CHANGED
@@ -9,7 +9,7 @@ Let's explain through an example. Say you have this classes:
9
9
  class Api
10
10
  def slow_method(a, b, c)
11
11
  ...
12
- #this is slow or dangerous, so you want to stub it in your tests
12
+ #this is slow, dangerous, or it's just an external dependency that should be stubbed
13
13
  ...
14
14
  end
15
15
  end
@@ -51,7 +51,7 @@ Which produces this output:
51
51
  GreatClass.singleton.stub!(:slow_method).with(123, AClass, "hi").and_return(another_class_instance)
52
52
  GreatClass.singleton.stub!(:slow_method).and_return(another_class_instance)
53
53
 
54
- So all class methods of the Api class and all its instances will raise this special exception while running the tests. If you prefer you can use it on a single instance like this:
54
+ So all unstubbed class methods of the Api class and its instances will raise this special exception while running the tests. If you prefer you can use it on a single instance like this:
55
55
 
56
56
  Stubborn.should_be_stubbed(Api.new)
57
57
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/lib/stubborn.rb CHANGED
@@ -1,10 +1,3 @@
1
- begin
2
- require 'proxen'
3
- rescue LoadError
4
- puts "You need to install the proxen gem: sudo gem install nakajima-proxen -s http://gems.github.com"
5
- exit
6
- end
7
-
8
1
  require 'suggesters/rspec_suggester'
9
2
  require 'missed_stub_exception'
10
3
 
@@ -18,8 +11,9 @@ module Stubborn
18
11
  end
19
12
 
20
13
  class ProxyForInstance
21
- attr_accessor :proxy_target
22
- proxy_to :proxy_target, :blank_slate => true
14
+ instance_methods.each do |sym|
15
+ undef_method(sym) unless sym.to_s =~ /__/ || sym.to_s == "send"
16
+ end
23
17
 
24
18
  def initialize(proxy_target, options = {})
25
19
  options = {:class => proxy_target.class}.merge(options)
data/stubborn.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{stubborn}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Daniel Cadenas"]
@@ -33,7 +33,7 @@ Expectations do
33
33
  reset_test_api_class
34
34
  api = TestApi.new
35
35
  api = Stubborn.should_be_stubbed(api)
36
- api.__send__(method, TestApi)
36
+ api.send(method, TestApi)
37
37
  end
38
38
  end
39
39
 
@@ -42,7 +42,7 @@ Expectations do
42
42
  reset_test_api_class
43
43
  api = TestApi.new
44
44
  proxied_api = Stubborn.should_be_stubbed(api)
45
- proxied_api.__send__(method, api)
45
+ proxied_api.send(method, api)
46
46
  end
47
47
  end
48
48
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stubborn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Cadenas