ð£ RSpecã§ã¹ã¿ãã®ä½æallowã¡ã½ããã§ã¹ã¿ã(ãã¹ãã®éããã®ã¢ã¸ã¥ã¼ã«ã®ä»£ããã«ç¨ãã代ç¨å)ãæ§ç¯ã§ãã¾ãã RSpec.describe "Specifying a return value" do it "returns the specified return value" do dbl = double allow(dbl).to receive(:foo).and_return(14) expect(dbl.foo).to eq(14) end end RSpec.describe "allow_any_instance_of" do it "returns the specified value on any instance of the class" do allow_any_instance_of(Object).to receive(:foo).and_


{{#tags}}- {{label}}
{{/tags}}