Sha256: 9d5b16eac69349c1ddba54e0925aa045b7f0fe0c107ad560c113e16785819df2

Contents?: true

Size: 574 Bytes

Versions: 37

Compression:

Stored size: 574 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

module BugReport600
  class ExampleClass
    def self.method_that_uses_define_method
      define_method "defined_method" do |attributes|
        load_address(address, attributes)
      end
    end
  end
 
  describe "stubbing a class method" do
    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

37 entries across 37 versions & 6 rubygems

Version Path
dchelimsky-rspec-1.1.11.1 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.1 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.13 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.2 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.3 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.4 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.5 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.6 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.7 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.8 spec/spec/mocks/bug_report_600_spec.rb
dchelimsky-rspec-1.1.99.9 spec/spec/mocks/bug_report_600_spec.rb
newbamboo-evented-rspec-1.1.12 spec/spec/mocks/bug_report_600_spec.rb
newbamboo-rspec-1.1.12 spec/spec/mocks/bug_report_600_spec.rb