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

Travis task to run tests against example solutions #67

Closed
kytrinyx opened this issue Dec 18, 2014 · 6 comments
Closed

Travis task to run tests against example solutions #67

kytrinyx opened this issue Dec 18, 2014 · 6 comments

Comments

@kytrinyx
Copy link
Member

This will require a couple of small things:

  • auto-rewriting the require statement to include example instead of the actual file name.
  • getting rid of skips (either by deleting the skip lines, or requiring a file that redefines skip to be an empty method).
@kotp
Copy link
Member

kotp commented Dec 19, 2014

This may not be the simplest thing to do, I have noticed that the required file is not always the same as the test file... the pattern doesn't hold, for example, for the leap_year exercise. They have leap_test.rb but the required file is year, rather than leap... This makes sense for the exercise, but not for matching for automated testing.

@kytrinyx
Copy link
Member Author

Yeah, that's part of the reason why I haven't done it yet.

I would be OK with changing the name of the require, actually, if that would help, though it pains me a bit to have a leap.rb that defines a Year constant (another reason why I've been putting this off).

Another option would be to add a marker to the line to be replaced as a trailing comment. That would allow us to have any name for the file and still recognize it consistently.

@kotp
Copy link
Member

kotp commented Dec 19, 2014

Whatever the plugin says, it could be thusly done (pseudo-code):

begin
  require '_test'  
rescue LoadError
  'File not created yet, using example.rb'
  require 'example.rb'
end
class Minitest::Test
  def skip ; end
end

The last monkey patches the skip method so that all tests run. The prior makes it so that example.rb that is required anyway per the API is accounted for. The consistency is provided by example.rb

@kytrinyx
Copy link
Member Author

Oh, yeah, that would totally work.

@kotp
Copy link
Member

kotp commented Jun 1, 2015

I believe this has been effectively addressed...

@kytrinyx
Copy link
Member Author

kytrinyx commented Jun 1, 2015

Yepp. Thanks!

@kytrinyx kytrinyx closed this as completed Jun 1, 2015
gchan pushed a commit to gchan/xruby that referenced this issue Oct 18, 2016
There was some confusion about whether or not the order in the README has anything to do with
the order of arguments expected in the test suite.

This is not the case, since different languages have different idioms when it comes to
enumerating. See exercism#67.
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

2 participants