On 8/4/15, Hleb Valoshka <[email protected]> wrote:

Quite strange, because this code is correct, and it works for my
simple class made just to check it. Any help is appreciated.

> == after transpec ==
> describe Ridley::ClientResource do
>   subject { described_class.new(double('registry')) }
>
>   describe "#regenerate_key" do
>     let(:client_id) { "rspec-client" }
>     before { allow(subject).to receive_messages(find: nil) }
>
>     context "when a client with the given ID does not exist" do
>       before { expect(subject).to
> receive(:find).with(client_id).and_return(nil) }
>
>       it "raises a ResourceNotFound error" do
>         expect {
>           subject.regenerate_key(client_id)
>         }.to raise_error(Ridley::Errors::ResourceNotFound)
>       end
>     end
>   end
> end
> ====
>
> The problem that code in before {} does not work, and ...Mock... error
> raised instead of expected one.


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: 
https://lists.debian.org/caab-kckiikjdc-twvntpms2o68umdci4_wjsdz_7ynnaxra...@mail.gmail.com

Reply via email to