# RSpec on Ruby 1.9: before(:all) (Not Yet Implemented) pending messages instead of tests

**URL:** <https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337>\
**Category:** Ruby\
**Created:** [December 27, 2007, 7:29pm UTC](https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337 "2007-12-27T19:29:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [December 27, 2007, 7:29pm UTC](https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337/1 "2007-12-27T19:29:03Z")

</div>

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.

My setups:

a) Ubuntu-packaged Ruby 1.8.6p36 (ruby1.8 1.8.6.36-1ubuntu3),  
RubyGems 1.0.1 (rubygems 1.0.1-3) and RSpec 1.1.1 (in /var/lib/gems/1.8)

b) source-compiled Ruby 1.9.0-0 and RSpec 1.1.1  
(in /home/shot/opt/ruby/lib/ruby/gems/1.9.0)

Now for the examples (two scenarios, both  
with fresh shell, so the same original $PATH):

a)

shot@devielle:~/work/PhD/bzr/trunk$ export  
PATH=/var/lib/gems/1.8/bin:$PATH  
shot@devielle:~/work/PhD/bzr/trunk$ spec spec/architecture\_spec.rb  
…

Finished in 0.00815 seconds

3 examples, 0 failures

b)

shot@devielle:~/work/PhD/bzr/trunk$ export  
PATH=/home/shot/opt/ruby/bin:$PATH  
shot@devielle:~/work/PhD/bzr/trunk$ spec spec/architecture\_spec.rb  
PPP

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?

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

```

– Shot

---

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [December 27, 2007, 9:19pm UTC](https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337/2 "2007-12-27T21:19:38Z")

</div>

Shot (Piotr S.):

> 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.

– Shot

---

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [December 27, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337/3 "2007-12-27T22:23:38Z")

</div>

On Dec 27, 2007 3:18 PM, Shot (Piotr S.) [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> 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/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [December 29, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337/4 "2007-12-29T17:03:39Z")

</div>

On Dec 29, 2007 7:44 AM, David C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ```
> > begin; \
> > @handling_predicate = true
> > 
> > ```
> 
> 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 😃

## – Luis L. 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

---

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [December 29, 2007, 11:44am UTC](https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337/5 "2007-12-29T11:44:47Z")

</div>

On Dec 27, 2007 4:28 PM, Shot (Piotr S.) [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.

> 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](http://rspec.lighthouseapp.com).

The “Not Yet Implemented” issue you had is fixed in trunk now.

> +# require ‘Win32/Console/ANSI’ if @colour && PLATFORM =~ /win32/; \
> 
> - 
> 
> ```
> ["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

---

<div class="post-metadata">

**Author:** ![Shot\_SPiotr\_S.S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Shot\_SPiotr\_S.S](https://www.ruby-forum.com/u/Shot_SPiotr_S.S)\
**Post date:** [January 2, 2008, 9:02am UTC](https://www.ruby-forum.com/t/rspec-on-ruby-1-9-before-all-not-yet-implemented-pending-messages-instead-of-tests/124337/6 "2008-01-02T09:02:36Z")

</div>

David C.:

> On Dec 27, 2007 4:28 PM, Shot (Piotr S.) [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](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.

> > ```
> > 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:🏃‍♂️: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](http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/215)

– Shot
