draper/spec
Bruno Castro d44c86f1e5 fix: Don't delegate public methods overridden by a private in the decorator (#849)
Public methods defined on the object was being delegated to the decorator even though it was overridden by a private method.

## Testing
1. Create a simple PORO with a public method
```ruby
class Job
  def location
    Struct.new(:id) { }
  end
end
```

1. Create a decorator and override the public method with a private
```ruby
class JobDecorator < Draper::Decorator
  delegate_all

  private

  def location
    LocationDecorator.new(object.location)
  end
end
```

3. It should raise an exception when calling `.location` from the decorator
```ruby
[9] pry(main)> JobDecorator.decorate(Job.new).location
NoMethodError: private method `location' called for #<JobDecorator:0x0000559f113ba118>
```

## References
* Issue #771
2019-03-18 11:35:29 -05:00
..
draper fix: Don't delegate public methods overridden by a private in the decorator (#849) 2019-03-18 11:35:29 -05:00
dummy Feature: ActiveJob Integration and Documentation (#817) 2017-09-11 09:35:14 -07:00
generators Add SimpleCov for code coverage analysis (#851) 2019-03-18 08:21:35 -05:00
integration Add SimpleCov for code coverage analysis (#851) 2019-03-18 08:21:35 -05:00
performance remove old compatibility code 2016-07-04 16:07:06 -05:00
support update rspec syntax to the new one 2016-06-09 18:49:42 -03:00
spec_helper.rb Add SimpleCov for code coverage analysis (#851) 2019-03-18 08:21:35 -05:00