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

Tidy up tests #290

Merged
merged 3 commits into from
Jun 22, 2016
Merged

Tidy up tests #290

merged 3 commits into from
Jun 22, 2016

Conversation

iainbeeston
Copy link
Contributor

I've tidied up a few things in the test directory that were annoying me:

  1. Made test classes consistently named FooTest (not TestFoo, FooTests or just Foo)
  2. Renamed test files to match the test class that they contain
  3. Moved test_helper.rb out of the /test directory and into /test/support
  4. Renamed any tests that had inaccurate, vague or misleading names

@iainbeeston
Copy link
Contributor Author

Any thoughts on this? (My goal is to make it easier to know where to add new tests, by making the naming of existing ones more consistent)

@iainbeeston
Copy link
Contributor Author

@RST-J do you think this is a good idea? Or can you suggest any changes?

@RST-J
Copy link
Contributor

RST-J commented May 18, 2016

I'll have a look some time soon. I think this needs some time to think about. In general I like your idea and aim very much.

@@ -11,18 +11,28 @@ def test_schema_from_file
refute_valid schema_fixture_path('good_schema_1.json'), { "a" => "bad" }
end

def test_data_from_file
def test_data_from_file_v3
Copy link
Contributor

@RST-J RST-J Jun 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this preferably called data_from_file_v3_test according to the new naming scheme? And all other tests in here also then.
P.S.: Or, I guess, only classes get the suffix 'Test' and test methods have it as prefix. That's also fine too me, consistency ist the point, so 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test unit only runs methods starting with test_ - so this is the correct method name. I've also checked the other test classes and they all seem to have correct test method names

@RST-J
Copy link
Contributor

RST-J commented Jun 16, 2016

Not sooo soon, but finally. I think it's fine. 👍

@iainbeeston iainbeeston merged commit ab96e9a into voxpupuli:master Jun 22, 2016
@iainbeeston iainbeeston deleted the tidy-tests branch June 22, 2016 14:24
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

Successfully merging this pull request may close these issues.

2 participants