clbustos / distribution

Statistical Distributions multi library wrapper. Uses Ruby by default and C (statistics2/GSL) or Java extensions where available.
Other
141 stars 52 forks source link

not enough 'require' to run correctly spec/weibull_spec.rb #18

Open boutil opened 9 years ago

boutil commented 9 years ago

Hi,

Currently, when I run rspec, I get the following error:

/home/boutil/src/ruby/distribution/distribution/spec/weibull_spec.rb:5:in `<top (required)>': uninitialized constant Distribution::Weibull (NameError)
        from /usr/lib/ruby/vendor_ruby/rspec/core/configuration.rb:1327:in `load'
        from /usr/lib/ruby/vendor_ruby/rspec/core/configuration.rb:1327:in `block in load_spec_files'
        from /usr/lib/ruby/vendor_ruby/rspec/core/configuration.rb:1325:in `each'
        from /usr/lib/ruby/vendor_ruby/rspec/core/configuration.rb:1325:in `load_spec_files'
        from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:103:in `setup'
        from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:89:in `run'
        from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:74:in `run'
        from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:42:in `invoke'
        from /usr/bin/rspec:4:in `<main>'

For some strange reason, when loading the spec_helper, distribution/weibull.rb is not loaded, whereas distribution.rb is. Adding require "distribution/weibull" to spec/weibull_spec.rb does the trick, but it is just a workaround.