#459 √ resolved
David Chelimsky

config.before(:suite) doesn't ever get run

Reported by David Chelimsky | July 6th, 2008 @ 07:32 AM | in 1.1.5

Spec::Runner.configure do |config|
  config.before(:suite) do
    puts "in before suite"
  end
end
rake spec

"in before suite" never appears in the output

Comments and changes to this ticket

  • David Chelimsky

    David Chelimsky July 6th, 2008 @ 01:24 PM

    Actually it does, just not when using rake :(

  • David Chelimsky

    David Chelimsky July 6th, 2008 @ 02:31 PM

    Actually it's not rake that's the problem - it's the spec command (which gets invoked by rake).

    As of http://github.com/dchelimsky/rsp...:

    $ cd stories/resources/spec/
    [david@mac spec]$ ruby before_blocks_example.rb 
    ...
    
    Finished in 0.013696 seconds
    
    3 examples, 0 failures
    $ ../../../bin/spec before_blocks_example.rb 
    F..
    
    1)
    'stuff in before blocks with :suite should be available in the example' FAILED
    expected: "before suite",
         got: nil (using ==)
    ./before_blocks_example.rb:19:
    
    Finished in 0.013865 seconds
    
    3 examples, 1 failure
    
  • David Chelimsky

    David Chelimsky July 13th, 2008 @ 12:09 AM

    • → Milestone changed from “No-Milestone-Assigned” to “1.1.5”
    • → State changed from “new” to “resolved”

    (from [74fd2a7e6893e95a6d4706b1dcf209e436cf7d1e]) Apply before_suite_parts after loading files! [#459 state:resolved milestone:"1.1.5"]

    http://github.com/dchelimsky/rsp...

  • David Chelimsky

    David Chelimsky July 13th, 2008 @ 12:11 AM

    For anyone interested - the problem was that before_suite_parts were getting applied before files were loaded (when running w/ the spec command), so any behaviour assigned to before(:suite) in Spec::Runner.config was missed (because spec_helper got loaded later).

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

People watching this ticket