Sha256: 63e372853ec758cd8b0b5a62531c72fca1d06c8a9b035bdf6d8da31c93eac971

Contents?: true

Size: 553 Bytes

Versions: 12

Compression:

Stored size: 553 Bytes

Contents

require 'spec_helper'

module Spec
  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 "should return the value for the stub on the base class" do
        @base_class.find.should == "stubbed_value"
      end

      it "should return the value for the descendent class" do
        @concrete_class.find.should == "stubbed_value"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
rspec-instructure-1.3.3 spec/spec/mocks/bug_report_957_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/spec/spec/mocks/bug_report_957_spec.rb
rspec-1.3.2 spec/spec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.beta.4 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.beta.3 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.beta.2 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.beta.1 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.a10 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.a9 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.a8 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.a7 spec/rspec/mocks/bug_report_957_spec.rb
rspec-mocks-2.0.0.a6 spec/rspec/mocks/bug_report_957_spec.rb