Rick DeNatale
2007-Dec-27 21:22 UTC
[rspec-users] RSpec on Ruby 1.9: before(:all) (Not Yet Implemented) pending messages instead of tests
On Dec 27, 2007 3:18 PM, Shot (Piotr Szotkowski) <shot at hot.pl> wrote:> Shot (Piotr Szotkowski): > > > I happily hand-compiled Ruby 1.9.0-0 into /home/shot/opt/ruby today > > and I''m running into a strange error with RSpec ? all my examples work > > perfectly with Ruby 1.8 but are considered peding on Ruby 1.9. > > FWIW, I get the same result with this simplest spec: > > describe Array do > it ''should work'' do > a = [1, 2] > a.first.should == 1 > end > end > > RSpec 1.1.1 on Ruby 1.8 ? 1 example, 0 failures. > RSpec 1.1.1 on Ruby 1.9 ? 1 example, 0 failures, 1 pending. >You should probably bring this up on the rspec-users list (I''m copying this reply there). This is most likely either: 1) A bug in Ruby 1.9 - At least one bug was reported just before the 1.9.0 release which related to using module_eval inside a method. I''ve looked at the RSpec code and it''s using instance_eval inside a method, so there might be a related bug. I tried to come up with a simplified program which evidenced a failure, but couldn''t, but I didn''t try all that hard. 2) RSpec running into a subtle 1.9 incompatible language change. I didn''t see anything obvious, but that''s not to say it''s not there. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/
David Chelimsky
2007-Dec-29 10:44 UTC
[rspec-users] RSpec on Ruby 1.9: before(:all) (Not Yet Implemented) pending messages instead of tests
On Dec 27, 2007 4:28 PM, Shot (Piotr Szotkowski) <shot at hot.pl> wrote:> Hi. > > I happily hand-compiled Ruby 1.9.0-0 into /home/shot/opt/ruby today > and I''m running into a strange error with RSpec ? all my examples work > perfectly with Ruby 1.8 but are considered peding on Ruby 1.9.<snip/>> Pending: > ArtDecomp::Architecture before(:all) (Not Yet Implemented) > ArtDecomp::Architecture before(:all) (Not Yet Implemented) > ArtDecomp::Architecture before(:all) (Not Yet Implemented) > > Finished in 0.012114249 seconds > > 3 examples, 0 failures, 3 pending > > How can I bugtrack/fix this?RSpec''s tracker can be found at http://rspec.lighthouseapp.com. The "Not Yet Implemented" issue you had is fixed in trunk now.> I had to patch RSpec in the below manner to get it running > on Ruby 1.9, but I doubt these fixes can be the culprit. > > --- lib/spec/runner/options.rb.orig 2007-12-27 16:36:03.000000000 +0100 > +++ lib/spec/runner/options.rb 2007-12-27 16:36:28.000000000 +0100 > @@ -102,7 +102,7 @@ > def colour=(colour) > @colour = colour > begin; \ > - require ''Win32/Console/ANSI'' if @colour && PLATFORM =~ /win32/; \ > +# require ''Win32/Console/ANSI'' if @colour && PLATFORM =~ /win32/; \ > rescue LoadError ; \ > raise "You must gem install win32console to use colour on Windows" ; \ > end > --- lib/spec/matchers/be.rb.orig 2007-12-27 16:30:51.000000000 +0100 > +++ lib/spec/matchers/be.rb 2007-12-27 16:32:14.000000000 +0100 > @@ -124,7 +124,8 @@ > def parse_expected(expected) > if Symbol === expected > @handling_predicate = true > - ["be_an_","be_a_","be_"].each do |@prefix| > + ["be_an_","be_a_","be_"].each do |at_prefix| > + @prefix = at_prefix > if expected.starts_with?(@prefix) > return "#{expected.to_s.sub(@prefix,"")}".to_sym > end >The change to be.rb has already been applied, but not the change to options.rb. I''m not sure I see any relationship between that and problems you might be experiencing with 1.9 (unless win32console does not yet support 1.9). Feel free to submit a ticket to the tracker on this one. Cheers, David
Luis Lavena
2007-Dec-29 15:49 UTC
[rspec-users] RSpec on Ruby 1.9: before(:all) (Not Yet Implemented) pending messages instead of tests
On Dec 29, 2007 7:44 AM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Dec 27, 2007 4:28 PM, Shot (Piotr Szotkowski) <shot at hot.pl> wrote: > > > I had to patch RSpec in the below manner to get it running > > on Ruby 1.9, but I doubt these fixes can be the culprit. > > > > --- lib/spec/runner/options.rb.orig 2007-12-27 16:36:03.000000000 +0100 > > +++ lib/spec/runner/options.rb 2007-12-27 16:36:28.000000000 +0100 > > @@ -102,7 +102,7 @@ > > def colour=(colour) > > @colour = colour > > begin; \ > > - require ''Win32/Console/ANSI'' if @colour && PLATFORM =~ /win32/; \ > > +# require ''Win32/Console/ANSI'' if @colour && PLATFORM =~ /win32/; \ > > rescue LoadError ; \ > > raise "You must gem install win32console to use colour on Windows" ; \ > > end > > --- lib/spec/matchers/be.rb.orig 2007-12-27 16:30:51.000000000 +0100 > > +++ lib/spec/matchers/be.rb 2007-12-27 16:32:14.000000000 +0100 > > @@ -124,7 +124,8 @@ > > def parse_expected(expected) > > if Symbol === expected > > @handling_predicate = true > > - ["be_an_","be_a_","be_"].each do |@prefix| > > + ["be_an_","be_a_","be_"].each do |at_prefix| > > + @prefix = at_prefix > > if expected.starts_with?(@prefix) > > return "#{expected.to_s.sub(@prefix,"")}".to_sym > > end > > > > The change to be.rb has already been applied, but not the change to > options.rb. I''m not sure I see any relationship between that and > problems you might be experiencing with 1.9 (unless win32console does > not yet support 1.9). Feel free to submit a ticket to the tracker on > this one.David, will not be better set @colour back to false if the require failed, instead of raising the exception? In that way, colour is automatically disabled, the user warned and when win32console gets updated for 1.9, all users will be happy :-D -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams
Shot (Piotr Szotkowski)
2008-Jan-02 08:06 UTC
[rspec-users] RSpec on Ruby 1.9: before(:all) (Not Yet Implemented) pending messages instead of tests
David Chelimsky:> On Dec 27, 2007 4:28 PM, Shot (Piotr Szotkowski) <shot at hot.pl> wrote:>> I happily hand-compiled Ruby 1.9.0-0 into /home/shot/opt/ruby today >> and I''m running into a strange error with RSpec ? all my examples work >> perfectly with Ruby 1.8 but are considered pending on Ruby 1.9.>> How can I bugtrack/fix this?> RSpec''s tracker can be found at http://rspec.lighthouseapp.com.Right; I?m not too fluent in RSpec yet (in particular, I didn?t use any pending specs yet), so I just wanted to ask around before filing a ticket.> The "Not Yet Implemented" issue you had is fixed in trunk now.Most appreciated! I?ll wait for RSpec 1.1.2 before switching to Ruby 1.9 in full then. BTW: The tracker says 1.1.2 ?is 11 months late? and ?Expected: Jan 17th, 2007?. Is 1.1.2 expected in two weeks? time and it should be 2008 there?>> I had to patch RSpec in the below manner to get it running >> on Ruby 1.9, but I doubt these fixes can be the culprit.>> --- lib/spec/runner/options.rb.orig 2007-12-27 16:36:03.000000000 +0100 >> +++ lib/spec/runner/options.rb 2007-12-27 16:36:28.000000000 +0100 >> @@ -102,7 +102,7 @@ >> def colour=(colour) >> @colour = colour >> begin; \ >> - require ''Win32/Console/ANSI'' if @colour && PLATFORM =~ /win32/; \ >> +# require ''Win32/Console/ANSI'' if @colour && PLATFORM =~ /win32/; \ >> rescue LoadError ; \ >> raise "You must gem install win32console to use colour on Windows" ; \ >> end> The change to be.rb has already been applied, but not the change > to options.rb. I''m not sure I see any relationship between that and > problems you might be experiencing with 1.9 (unless win32console does > not yet support 1.9).Sorry for not explaining this one. This is with using `spec -c -D u` on Ubuntu (with diff-lcs installed) ? I keep running into an ?uninitialized constant Spec::Runner::Options::PLATFORM? error, hence the simplest above workaround. Might be a bug in Ruby 1.9 not scoping the class constants properly, though.> Feel free to submit a ticket to the tracker on this one.#215 filed: http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/215 -- Shot --> So, this guy gets into Guinness by riding a 70-foot wave, > toppling the previous record-holder''s 68-footer. How do they > measure the height of the waves to that degree of accuracy?With a barometer, silly. -- John Hatpin and Stan, afca -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: not available Url : http://rubyforge.org/pipermail/rspec-users/attachments/20080102/1efb7789/attachment.bin