Guest User

Untitled

a guest
Jun 18th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. commit 88cfcc2eaabe74efeb78a1847dbee1ac20e1d46d
  2. Author: Ben Brinckerhoff <ben@bbrinck.com>
  3. Date: Tue Oct 12 22:13:50 2010 -0600
  4.  
  5. Added failing spec for class_eval bug
  6.  
  7. diff --git a/spec/ruby/core/module/shared/class_eval.rb b/spec/ruby/core/module/shared/class_eval.rb
  8. index fb9f6a7..e725ff9 100644
  9. --- a/spec/ruby/core/module/shared/class_eval.rb
  10. +++ b/spec/ruby/core/module/shared/class_eval.rb
  11. @@ -31,6 +31,11 @@ describe :module_class_eval, :shared => true do
  12. ModuleSpecs.send(@method, "[__FILE__, __LINE__]", "test", 102).should == ["test", 102]
  13. end
  14.  
  15. + it "converts a non-string filename to a string using to_str" do
  16. + (file = mock(__FILE__)).should_receive(:to_str).and_return(__FILE__)
  17. + ModuleSpecs.send(@method, "1+1", file)
  18. + end
  19. +
  20. it "converts non string eval-string to string using to_str" do
  21. (o = mock('1 + 1')).should_receive(:to_str).and_return("1 + 1")
  22. ModuleSpecs.send(@method, o).should == 2
Add Comment
Please, Sign In to add comment