gnecula / bond

Spy-based testing library.
http://necula01.github.io/bond/
Other
7 stars 3 forks source link

New filename convention for RSpec? #19

Closed xkrogen closed 9 years ago

xkrogen commented 9 years ago

The way observations are named by default when using Bond with RSpec is the entire test description, which is often very verbose. Some of the current bond_test observations (which I think are reasonable length for rspec) are over 100 characters, which exceeds the character limit for filenames to be included in a gem.

Something else needs to be used, though it's not really clear what would be best suited. Imposing a 100-character limit may be reasonable, but could result in a lot of overlap. Something like a 90-character limit plus some sort of unique string at the end (e.g. a hash of the full description) could resolve that, but isn't very human-friendly. Those are my only ideas for now, but I'll keep thinking about it.

gnecula commented 9 years ago

This is a good point. There are a couple of reasons why the name should be recognizable. One is that during merging you want to know what test is involved, and often the file name is the only thing that is visible in the UI. Second, sometimes you want to scan the observation for a test. I do this very rarely, but it would be annoying to not be able to do it.

I think that even in rspec one would want to use some discipline in naming tests, because you need to find the test that is failing. I think it is Ok to specify that if the name is longer than a certain limit, we add unique chars at the end (a hash of the whole name).

George.

On Tue, Oct 27, 2015 at 12:54 AM, Erik notifications@github.com wrote:

The way observations are named by default when using Bond with RSpec is the entire test description, which is often very verbose. Some of the current bond_test observations (which I think are reasonable length for rspec) are over 100 characters, which exceeds the character limit for filenames to be included in a gem.

Something else needs to be used, though it's not really clear what would be best suited. Imposing a 100-character limit may be reasonable, but could result in a lot of overlap. Something like a 90-character limit plus some sort of unique string at the end (e.g. a hash of the full description) could resolve that, but isn't very human-friendly. Those are my only ideas for now, but I'll keep thinking about it.

— Reply to this email directly or view it on GitHub https://github.com/necula01/bond/issues/19.

xkrogen commented 9 years ago

Implemented this change.