dkubb / axiom

Simplifies querying of structured data using relational algebra
https://github.com/dkubb/axiom
MIT License
459 stars 22 forks source link

load axiom before ice_nine_config gets loaded #43

Closed zirni closed 10 years ago

zirni commented 10 years ago
$ bundle install
$ bundle exec rspec spec
spec/support/ice_nine_config.rb:5:in `<class:Freezer>': uninitialized constant IceNine::Freezer::NoFreeze (NameError)

Need to load axiom before ice_nine_config gets loaded to solve the above exception.

snusnu commented 10 years ago

i had to make a change to substation too. The relevant commit in devtools was this: https://github.com/rom-rb/devtools/commit/5a9edad093acad5d73e31107785eb57651704107

dkubb commented 10 years ago

Won't this cause simplecov to not track the files in axiom? I thought it had to be required before the library it's measuring.

zirni commented 10 years ago

@dkubb Yes, that's correct. Just closing this pull request and take @snusnu hint into account.

zirni commented 10 years ago

Just see that I've haven't provide enough backtrace. The error was in ice_nine_config.rb in axiom. Was ice_nine_config.rb copied from devtools to axiom somehow earlier?

snusnu commented 10 years ago

@zirni @dkubb i actually meant to add a link to the actual substation code, but for some reason, did not. So here it is: https://github.com/snusnu/substation/blob/decentralized_dispatch_table/spec/spec_helper.rb#L1-L24. And yeah, in order for simplecov to do it's thing, it must be configured before requiring the code, and devtools/spec_helper must be required after ice_nine, or the code that requires ice_nine.

dkubb commented 10 years ago

@zirni I believe this may be fixed by this commit: https://github.com/dkubb/axiom/commit/c3d57e517da97b6b4e103a83f917e306785e7e83

The configuration file that is causing an issue was actually extracted from axiom first, then moved to devtools, but I guess the duplicate file in axiom was never removed. The file in now removed, and then devtools requires it's own equivalent file after axiom itself is loaded.

Let me know if this works for you.

zirni commented 10 years ago

@dkubb works right away.

dkubb commented 10 years ago

@zirni awesome, thanks for confirming.