-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Repo cleaning and migration from munit to buddy. #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just some minor comments.
@@ -1,7 +1,7 @@ | |||
{ | |||
"language": "Haxe", | |||
"active": false, | |||
"blurb": "", | |||
"blurb": "Haxe is an open source high-level strictly-typed programming language with a fast optimizing cross-compiler. Haxe can build cross-platform applications targeting JavaScript, C++, C#, Java, JVM, Python, Lua, PHP, Flash, and allows access to each platform's native capabilities. Haxe has its own VMs (HashLink and NekoVM) but can also run in interpreted mode. Code written in Haxe can be compiled to any target Haxe supports.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add the online_editor
key? See https://github.com/exercism/csharp/blob/master/config.json#L5 for an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the online_editor key.
it("stating something", { | ||
Bob.hey("Tom-ay-to, tom-aaaah-to.").should.be(WHATEVER); | ||
}); | ||
it("shouting", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, tracks that support it have all tests ignored except for the first test. See for example the C# bob tests. The idea is that it forces students to solve tests one at a time, effectively engaging in TDD. Is this something that is supported by the test framework?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add a pending call which will skip over a test. Then users can just comment it out to run the test.
it("stating something", {
Bob.hey("Tom-ay-to, tom-aaaah-to.").should.be(WHATEVER);
});
it("shouting", {
pending("Skipping");
Bob.hey("WATCH OUT!").should.be(CHILL);
});
XPPPPPPPPPPPPPPPPPPPPPPPP
Bob
stating something (FAILED)
Not Implemented
@ /home/davidbruce/Git/haxe/buddy/src/buddy/SuitesRunner.hx:519
@ test/Test.hx:16
@ src/Bob.hx:5
shouting (Pending)
test/Test.hx:19: Skipping
shouting gibberish (Pending)
test/Test.hx:23: Skipping
asking a question (Pending)
test/Test.hx:27: Skipping
asking a numeric question (Pending)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would be great!
@ErikSchierboom I've made the requested changes, go ahead and merge if you approve. |
@davidbruce I've just noticed that you're not yet in the maintainers.config file. Could you add yourself to that file? That will give you the appropriate permissions on this repo. For an example of what an entry should look like, see https://github.com/exercism/csharp/blob/master/config/maintainers.json#L3 |
* Migration from munit to buddy, updates config.json and adds tests.toml. * Add online_editor to config.json * Updates exercises to skip all but the first test.
This is a large scale change that will simplify test generation from the problem specification repo.
New Testing Framework
Buddy is a BDD framework that does not rely on any external configuration files or auto generated classes like munit. A test suite all lives within a constructor of a class that extends buddy.SingleSuite.
Below is an example of translating two tests from canonical-data.json to tests for the Bob exercise.
canonical-data.json:
Test.hx:
Running the tests
The test.hxml files have all been updated as well to make use of the -x flag, so that files are generated and ran immediately on the NekoVM. This makes all of the makefiles that were previously used no longer necessary. Also all tests are now just named Test.hx to allow for a single test.hxml to be copied to all exercies. So, running tests is as easy as:
test.hxml:
Other issues fixed:
The EXERCISES.txt file was removed, since that doesn't appear in any other exercism tracks, so it may just be an old relic.
Fixed the Hello world example, it was missing a closing ", so it failed to compile.
Fixed the Bob example to pass all tests. It was missing the calm condition.
Fixed the Leap example, it looks like it was copied from javascript, so === and !== were replaced with != and ==.
Updated
docs/TESTS.md
I have added all the required
.meta/test.toml
files making PR #51 redundant.I have added topics and blurb to config.json for #7.
I have added the stub for bob requested in # #48 .
@ErikSchierboom Please let me know if there are any changes needed. Once this is moved in I'll submit a new PR with the majority of other exercises once I have the generator fully functional. If all is well with your review please just got ahead and merge it since I cannot.