Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .rspec #47

Open
moseshll opened this issue May 8, 2024 · 0 comments
Open

Use .rspec #47

moseshll opened this issue May 8, 2024 · 0 comments

Comments

@moseshll
Copy link
Contributor

moseshll commented May 8, 2024

Some specs rely on being run all at once so the constants defined in spec_helper.rb are available everywhere, but may not have the explicit require "spec_helper" line. The most concise thing to do is probably to add an .rspec with a --require spec_helper line. Alternatively we could just add the missing requires but why not just assume all the specs should have the helper available?

As reported:

### without spec_helper in spec/hathifile_history/records_spec.rb 

$ bundle exec rspec spec/hathifile_history/records_spec.rb
.........................E, [2024-05-07T15:20:38.146248 #423] ERROR -- : Can't get yyyymm from filename 'blah'. Aborting
..E, [2024-05-07T15:20:38.146871 #423] ERROR -- : Can't get yyyymm from filename 'blah'. Aborting
...

Finished in 0.01617 seconds (files took 0.72769 seconds to load)
30 examples, 0 failures

Coverage report generated for RSpec to /usr/src/app/coverage. 275 / 392 LOC (70.15%) covered.
Lcov style coverage report generated for RSpec to coverage/lcov.info
root@e1114083d61c:/usr/src/app# bundle exec rspec spec/hathifile_history/records_spec.rb

An error occurred while loading ./spec/hathifile_history/records_spec.rb.
Failure/Error: VALID_LINE = "#{TEST_HTID}\tdeny\tic\t#{TEST_RECID}\tother fields..."

NameError:
  uninitialized constant TEST_HTID
# ./spec/hathifile_history/records_spec.rb:7:in `<top (required)>'
No examples found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant