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

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.99.4 spec/rspec/mocks/bug_report_957_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.99.3 spec/rspec/mocks/bug_report_957_spec.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-mocks-2.13.0/spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.99.2 spec/rspec/mocks/bug_report_957_spec.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.99.1 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.99.0 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.99.0.rc1 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.14.6 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.99.0.beta2 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.14.5 spec/rspec/mocks/bug_report_957_spec.rb