[rspec-users] Apparent regression in rspec 2 on ruby 1.9: constant resolution fails in describes in nested modules

2010-11-04 Thread Rhett Sutphin
Hi, I've converted a couple of my smaller libraries' spec suites to rspec 2 with no trouble. (I'm enjoying the new version -- thanks to all involved.) I'm trying to convert one a larger suite now and I've run into two problems on ruby 1.9.1 (but not 1.8.7) related to constant resolution in de

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread David Chelimsky
On Nov 4, 2010, at 7:18 PM, Jarmo Pertman wrote: > Upgrade to RSpec 2.x has been more painful than i expected. A lot more > painful. > > Subject#subject behavior with "self" is also broken! > > This fails in RSpec 2 with stack overflow: > describe "something" do > subject { self } > > it "is

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
Upgrade to RSpec 2.x has been more painful than i expected. A lot more painful. Subject#subject behavior with "self" is also broken! This fails in RSpec 2 with stack overflow: describe "something" do subject { self } it "is ok?" do should be_ok end def ok? true end end It is

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
It also fails with RCov very strangely when including module in RSpec.configure block like this: # spec/my_lib_spec.rb require "rspec" describe "should work" do it "with rcov also" do MyLib.should be my_method.should == "works" end end # lib/my_lib.rb require "rspec" module MyLib

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
There seems to be also a problem when using RCov raketask - it doesn't seem to load RSpec. Consider the following project structure: # Rakefile require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |spec| end RSpec::Core::RakeTask.new(:rcov) do |spec| spec.rcov = true end # lib/m

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
On Nov 4, 9:52 pm, Jarmo Pertman wrote: > I cannot reproduce this problem currently with standard html formatter > although i don't do anything with snippet extractor in my custom html > formatter. I need to investigate why the problem happens now and then. I've managed to reproduce it again and

Re: [rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
On Nov 4, 9:21 pm, Jarmo Pertman wrote: > 3) Why does html formatter snippet show always failing line as: >   raise(RSpec::Expectations::ExpectationNotMetError.new(message)) > > in 1.x it would show the failing line in the spec file instead... is > this a bug? I cannot reproduce this problem curr

[rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1

2010-11-04 Thread Jarmo Pertman
Hello! I'm trying to migrate my scripts from RSpec 1.3.0 to 2.0.1 having some issues so far. 1) I don't like is that ".rspec" has to be in the working directory and cannot be anymore in "spec". Okay, i can issue "mv spec/ spec.opts .rspec" in my projects, but why isn't it supported? 2) If there

Re: [rspec-users] Constant resolution fails in describes inside of modules using rspec 2 on ruby 1.9.1

2010-11-04 Thread Myron Marston
You can reorganize it a bit in a way that will work on 1.8.7, 1.9.1 and 1.9.2: module Foo module Quux class Baz def name "noise" end end end end describe Foo::Quux::Baz do it "has a name" do described_class.new.name.should == 'noise' end end __