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

not enough 'require' to run correctly spec/hunk_spec.rb #33

Closed
boutil opened this issue Aug 12, 2015 · 5 comments
Closed

not enough 'require' to run correctly spec/hunk_spec.rb #33

boutil opened this issue Aug 12, 2015 · 5 comments
Assignees

Comments

@boutil
Copy link

boutil commented Aug 12, 2015

Hi,

When running rspec on a checkout of the repository, I get:

Failed examples:

rspec ./spec/hunk_spec.rb:17 # Diff::LCS::Hunk should be able to produce a unified diff from the two pieces
rspec ./spec/hunk_spec.rb:26 # Diff::LCS::Hunk should be able to produce a context diff from the two pieces
rspec ./spec/hunk_spec.rb:38 # Diff::LCS::Hunk should be able to produce an old diff from the two pieces
rspec ./spec/hunk_spec.rb:49 # Diff::LCS::Hunk should be able to produce a reverse ed diff from the two pieces
rspec ./spec/hunk_spec.rb:62 # Diff::LCS::Hunk with empty first data set should be able to produce a unified diff

they all fail with the following error:

 NameError:
       uninitialized constant Diff::LCS::Hunk

There is no 'require' chain loading lib/diff/lcs/hunk.rb from spec_helper. Adding require 'diff/lcs/hunk' to either spec/spec_helper.rb or spec/hunk_spec.rb does the trick.

This bug is also referenced by the Debian project:
http://bugs.debian.org/794164

@halostatue halostatue self-assigned this Aug 13, 2015
@halostatue
Copy link
Owner

Thank you for reporting this. It would have been nice if Debian had reported this upstream.

@boutil
Copy link
Author

boutil commented Aug 13, 2015

it just did. I am the Debian maintainer of the package :)

@halostatue
Copy link
Owner

Ah. ;) I will get this fixed soon.

@voxik
Copy link
Contributor

voxik commented Aug 20, 2015

@strzibny
Copy link

Workaround for running the test suite I am using:

$ rspec -rdiff/lcs -rdiff/lcs/hunk spec

halostatue added a commit that referenced this issue Jan 11, 2017
Fixes #33, #34 so that specs can be run independently.
halostatue added a commit that referenced this issue Jan 11, 2017
Fixes #33, #34 so that specs can be run independently.
halostatue added a commit that referenced this issue Jan 11, 2017
- Updated testing and gem infrastructure.
- Cleaning up documentation.
- Modernizing specs.
- Silence Ruby 2.4 Fixnum deprecation warnings. Fixes #36, #38.
- Ensure test dependencies are loaded. Fixes #33, #34 so that specs can be run
  independently.
- Fix issue #1 with incorrect intuition of patch direction. Tentative fix, but
  the failure cases pass now.
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

4 participants