Skip to content

Commit

Permalink
add failing example [#600]
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Nov 16, 2008
1 parent 9de97cc commit ad950d4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/spec/mocks/bug_report_600_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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
pending("fix to bug report: http://rspec.lighthouseapp.com/projects/5645/tickets/600") do
ExampleClass.method_that_uses_define_method
end
end
end
end

0 comments on commit ad950d4

Please sign in to comment.