Support ellipsis wildcards #9

Closed
tfausak opened this Issue Aug 20, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@tfausak

tfausak commented Aug 20, 2014

Python's doctest has an ellipsis options. It's useful for removing parts of a test that aren't important or are known to change. For example, creating a new object:

>>> object() # doctest: +ELLIPSIS
<object object at 0x...>
Trying:
    object() # doctest: +ELLIPSIS
Expecting:
    <object object at 0x...>
ok

This test doesn't care what the actual memory address of the object is. As far as I can tell, there is no way to write a test like this with Ruby DocTest.

>> Object.new
=> #<Object:0x...>
1.  FAIL | Default Test
           Got:      #<Object:0x007fc0b88c7c58>
           Expected: #<Object:0x...>
@tfausak

This comment has been minimized.

Show comment
Hide comment
@tfausak

tfausak Sep 2, 2014

It looks like normalize_result is supposed to handle this, but it's hard coded to only allow 8 hex digits.

tfausak commented Sep 2, 2014

It looks like normalize_result is supposed to handle this, but it's hard coded to only allow 8 hex digits.

@weakish

This comment has been minimized.

Show comment
Hide comment
@weakish

weakish Nov 6, 2014

With some ugliness:

>> Object.new.to_s =~ /#<Object:0x.+>/
=> 0

weakish commented Nov 6, 2014

With some ugliness:

>> Object.new.to_s =~ /#<Object:0x.+>/
=> 0
@tfausak

This comment has been minimized.

Show comment
Hide comment

@tfausak tfausak closed this Sep 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment