Sha256: eb26392123083bcecc3c5782cb69e40b4e584dde42ff44c4315c760e66fea14b

Contents?: true

Size: 553 Bytes

Versions: 18

Compression:

Stored size: 553 Bytes

Contents

require 'spec_helper'

module BugReport600
  describe "stubbing a class method" do
    class ExampleClass
      def self.method_that_uses_define_method
        define_method "defined_method" do |attributes|
          load_address(address, attributes)
        end
      end
    end
 
    it "should work" do
      ExampleClass.should_receive(:define_method).with("defined_method")
      ExampleClass.method_that_uses_define_method
    end

    it "should restore the original method" do
      ExampleClass.method_that_uses_define_method
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.beta.19 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.18 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.17 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.16 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.15 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.14 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.13 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.12 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.11 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.10 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.9 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.8 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.7 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.6 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.5 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.4 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.3 spec/rspec/mocks/bug_report_600_spec.rb
rspec-mocks-2.0.0.beta.2 spec/rspec/mocks/bug_report_600_spec.rb