Should be:
provider_class.stubs(:target).returns(target)
```ruby

```