Sha256: 75750c08e93c95782e412f59636f1ca005a6cc2054836afdb847269f2e35ef5f
Contents?: true
Size: 549 Bytes
Versions: 49
Compression:
Stored size: 549 Bytes
Contents
require 'spec_helper' module RSpec module Mocks describe "stubbing a base class class method" do before do @base_class = Class.new @concrete_class = Class.new(@base_class) @base_class.stub(:find).and_return "stubbed_value" end it "returns the value for the stub on the base class" do expect(@base_class.find).to eq "stubbed_value" end it "returns the value for the descendent class" do expect(@concrete_class.find).to eq "stubbed_value" end end end end
Version data entries
49 entries across 49 versions & 13 rubygems