#437 new
David Masover

Ruby 1.9 fails with inner describe

Reported by David Masover | June 13th, 2008 @ 11:44 PM | in No-Milestone-Assigned

As a control test, the following code works on both Ruby 1.8 and 1.9:

describe 'Just an outer description' do
  it "doesn't crash" do
    true.should be_true
  end
end

The following code works on Ruby 1.8 (but not 1.9):

describe 'An outer description' do
  describe 'with an inner description' do
    it "shouldn't crash" do
      true.should be_true
    end
  end
end

Log:

$ spec1.9 breaking_spec.rb

/usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:40:in `eval': wrong argument type Proc (expected Binding) (TypeError)

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:40:in `describe'

from /home/david/hacking/rspec/breaking_spec.rb:2:in `block in '

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:46:in `module_eval'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:46:in `block in describe'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/extensions/class.rb:14:in `instance_eval'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/extensions/class.rb:14:in `subclass'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:44:in `describe'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_factory.rb:46:in `create_example_group'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/extensions/main.rb:27:in `describe'

from /home/david/hacking/rspec/breaking_spec.rb:1:in `'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/runner/example_group_runner.rb:14:in `load'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/runner/example_group_runner.rb:14:in `block in load_files'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/runner/example_group_runner.rb:13:in `each'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/runner/example_group_runner.rb:13:in `load_files'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/runner/options.rb:98:in `run_examples'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/runner/command_line.rb:19:in `run'

from /usr/local/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/bin/spec:4:in `'

from /usr/local/bin/spec1.9:19:in `load'

from /usr/local/bin/spec1.9:19:in `'

Same behavior on all versions of 1.9 I tested with. The one which ships with Ubuntu Hardy:

ruby 1.9.0 (2007-12-25 revision 14709) [x86_64-linux]

One compiled from the 1.9.0.1 source:

http://svn.ruby-lang.org/repos/r...

ruby 1.9.0 (2008-03-01 revision 15665) [x86_64-linux]

And one compiled from trunk, as of right now, which seems to report itself as the same revision, for some reason:

http://svn.ruby-lang.org/repos/r...

ruby 1.9.0 (2008-06-14 revision 15665) [x86_64-linux]

Comments and changes to this ticket

  • David Chelimsky

    David Chelimsky June 14th, 2008 @ 01:38 AM

    See #211 - I haven't tested out yet but my suspicion is this related to the same bug, which has now been fixed in 1.9's trunk.

  • David Masover

    David Masover June 15th, 2008 @ 08:33 PM

    It's possible, though the error looks quite different.

    It's also possible I was doing it wrong, but I thought I updated to 1.9 trunk, and still had the exact same issue.

  • Brian Takita

    Brian Takita June 15th, 2008 @ 11:50 PM

    • → Assigned user changed from “” to “Brian Takita”

    I got this while running rspec on 1.9. I believe these are separate issues.

  • David Chelimsky

    David Chelimsky June 19th, 2008 @ 04:51 AM

    Brian - are you using 1.9 from trunk?

  • Gregory Brown

    Gregory Brown August 7th, 2008 @ 06:16 PM

    • → Tag changed from “” to “bug ruby19”

    This problem still exists in 1.9.0_3 :-/

    
    describe "A context" do
      describe "With nesting" do
        it "won't run in 1.9.0_3"
      end
    end
    
    
    $ ruby -v
    ruby 1.8.6 (2008-06-20 patchlevel 230) [i686-darwin8.11.1]
    $ spec foo.rb
    P
    
    Pending:
    A context With nesting won't run in 1.9.0_3 (Not Yet Implemented)
    
    Finished in 0.009706 seconds
    
    1 example, 0 failures, 1 pending
    
    
    $ ruby -v
    ruby 1.9.0 (2008-07-25 revision 18217) [i686-darwin8.11.1]
    $ spec foo.rb
    /Users/sandal/lib/ruby19/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:40:in `eval': wrong argument type Proc (expected Binding) (TypeError)
            from /Users/sandal/lib/ruby19/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:40:in `describe'
            from /Users/sandal/rspec-1.1.4/foo.rb:2:in `block in <top (required)>'
            from /Users/sandal/lib/ruby19/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:46:in `module_eval'
            from /Users/sandal/lib/ruby19/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/example/example_group_methods.rb:46:in `block in describe'
            from /Users/sandal/lib/ruby19/lib/ruby/gems/1.9.0/gems/rspec-1.1.4/lib/spec/extensions/class.rb:14:in `instance_eval'
    

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

Tags