radiant/radiant — Issue #300: Running extension specs on 1.0.0-rc3 loads Radiant initializers twice
Author: jfahrenkrug
Created: 2011-12-27 20:09:16+00:00
State: open
Labels: 1.x, bug

That causes the Radiant configuration to be loaded twice, resulting in an exception being thrown, namely:

/Users/johannes/.rvm/gems/ruby-1.9.2-p290/gems/radiant-1.0.0.rc3/app/models/radiant/config.rb:192:in `define': (LoadError)
Config definition error: 'admin.title' is defined twice:
1. /Users/johannes/.rvm/gems/ruby-1.9.2-p290/gems/radiant-1.0.0.rc3/config/initializers/radiant_config.rb:3:in `block in '
2. /Users/johannes/.rvm/gems/ruby-1.9.2-p290/gems/radiant-1.0.0.rc3/config/initializers/radiant_config.rb:3:in `block in '

How to reproduce:

1. Install the 1.0.0-rc3 gem
2. Run `radiant inittest` to create a new project
3. Edit the Gemfile in uncomment the "if you want to run tests..." block
4. Run `bundle install`
5. Run `./script/generate extension inittest` to create an extension
6. I had to edit the extension's Rakefile and comment out the RDoc Task at the bottom of the file.
7. Create a file called `foo_spec.rb` in `vendor/extensions/inittest/spec/models`
8. Put this in the file:

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

9. Save it.
10. Change into `vendor/extensions/inittest` and run `bundle exec rake spec`

Expected result: It should run without an error.

Actual result: Radiant's initializers are being run twice, resulting in the above exception.

I'm using Ruby 1.9.2.