rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.07k stars 161 forks source link

Tests are broken - cannot load such file -- rom/version #560

Closed DNNX closed 4 years ago

DNNX commented 4 years ago

Describe the bug

If I follow instructions from the readme on how to run tests, they all fail with cannot load such file -- rom/version. I see the same error happens on Travis - the last build is red because of it.

To Reproduce

docker-compose run --rm gem "bundle && rspec"

It will produce a wall of text, the top of which is

...
Bundle complete! 14 Gemfile dependencies, 40 gems now installed.
Bundled gems are installed into `/usr/local/bundle`

An error occurred while loading ./spec/spec_helper.
Failure/Error: require 'rom/core'

LoadError:
  cannot load such file -- rom/version
# /usr/local/bundle/gems/rom-core-5.1.0/lib/rom/core.rb:6:in `require'
# /usr/local/bundle/gems/rom-core-5.1.0/lib/rom/core.rb:6:in `<top (required)>'
# ./lib/rom/sql.rb:3:in `require'
# ./lib/rom/sql.rb:3:in `<top (required)>'
# ./lib/rom-sql.rb:1:in `require'
# ./lib/rom-sql.rb:1:in `<top (required)>'

I did a git bisect and found which commit breaks it.

52f189ec6073272c659ed352d22cecf72c8142fc is the first bad commit
commit 52f189ec6073272c659ed352d22cecf72c8142fc
Author: Piotr Solnica <piotr.solnica@gmail.com>
Date:   Wed Apr 24 11:02:00 2019 +0200

    Use released rom dependencies

:100644 100644 d84bdb4d593cbdb17c22fd526c2392ba8924b087 20d9d5761f546e344a4f47fa8c8c9d6d655519b4 M  Gemfile

Probably, what really happens is that it's not that 52f189ec6073272c659ed352d22cecf72c8142fc broke it, but probably some other changes in the rom itself.

Expected behavior

Green tests.

Your environment

solnic commented 4 years ago

This is because I moved rom/version in rom-core gem to rom/core/version and it looks like rom/core file requires rom/version. This works when you have rom gem installed, but when you don't it breaks. My bad. I'll fix it and push rom-core 5.1.1.

solnic commented 4 years ago

This was fixed via a18347d0251ab7a87d181ca9c5401b2ac1aee31c