Hi, guys!

I'm struggling with a problem. 

Class X
   def y
      YAML.load_file(...)
   end
end

In my spec I have

allow(YAML).to receive(:load_file).and_return(...)
expect(obj.y).to eq ...

And it works!

But, if I change the method to

def self.y
   ...
end

and the expect to:

expect(X.y)...


It does not work :(

How can I make this stub and make it work with my class method?

Thanks,
Paulo

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/46940dac-9fcc-4b6a-a6f2-7cfbbbe6e267%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to