-
Notifications
You must be signed in to change notification settings - Fork 136
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
Change 'tests' in definitions to be more generic #7
Comments
👍 |
Slight modification here. Instead of |
Aaaaannnnnnddd I've hit my first real problem. The above setup won't work unless I also include the region. We can't assume based on the file because of subregions. We'll need to add in a 'region' key. |
I was thinking about this. First of all, I would suggest to have a tests:
- given:
date: 2015-01-01
regions: ["us"] # could be optional unless you want to have something different than the files main locale
expect:
name: "New Year's Day"
holiday: true
- given:
date: 2015-10-10
observed: true
expect:
name: Columbus Day
- given:
date: 2016-06-15
expect:
holiday: false That would generate these tests:
|
Ooooh, I like this a lot! I have to agree regarding my current proposal. I've completed two definition file conversions with my format and I already don't like it. I've slowed down because...it just feels bad. Don't know how to describe it but I don't like it. I'm at work now but let me chew on this and I'll get back to you. Thank you so much for the input. |
I wrote the initial validator for the updated format and did the I made |
I have been converting test defs and I think I'm going to assume |
I made a small update to the proposed structure to allow for multiple dates to be passed in the Example: - given:
date: ['2011-08-15', '2012-08-15']
regions: ["pl"]
expect:
name: "Święto Wojska Polskiego" |
Awesome! |
@ptrimble That's good and useful!! 👍 |
Right now all of the 'tests' are ruby. This has to change if we want to use these definitions in other languages. We need a format that can express all of the tests that exist today in a YAML format.
My proposal:
The region should be implicit based on the current file being tested.
I'm going to try to do this now and the modify the ruby repository to generate based on these new definitions. If I do it right then the generated classes will look identical to the existing ones.
The text was updated successfully, but these errors were encountered: