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

Diff does not show trailing newline at end of file #327

Closed
ghoneycutt opened this issue Oct 9, 2015 · 2 comments
Closed

Diff does not show trailing newline at end of file #327

ghoneycutt opened this issue Oct 9, 2015 · 2 comments
Labels

Comments

@ghoneycutt
Copy link

The new diff style output is great though if a newline is at the end of the file, it does not show it.

comparison of

a file with an empty line at the bottom

foo
bar

with

a file without an empty line at the bottom

foo
bar

results in

Failure/Error: it { should contain_file('foo').with_content(fixture) }
   expected that the catalogue would contain File[foo] with content set to supplied string
   Diff:

After reverting from using master in the git repo in my Gemfile to using the newest release it gave me the old style string output where it was obvious that the file ended with "\n\n" instead of "\n"

If I put dummy data at the beginning of the file or otherwise, it would correctly show empty lines with a + sign on its own line as you would expect from diff, though the last line it seems to be missing.

@DavidS DavidS added the bug label Oct 9, 2015
@DavidS
Copy link
Collaborator

DavidS commented Dec 14, 2015

This is an upstream rspec issue. I've submitted that as rspec/rspec-core#2134

@ghoneycutt
Copy link
Author

@DavidS Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants