pocke / rbs_rails

Apache License 2.0
285 stars 33 forks source link

Refactor test by separating files for expected RBS #194

Closed pocke closed 3 years ago

pocke commented 3 years ago

This PR separates the test file and the excepted RBS file.

It improves the maintainability of the snapshot test. We can easily update the expected RBS with expect_path.write rbs_path.read code which is in the test code.

This idea is inspired by Racc. https://github.com/ruby/racc/blob/e77720168bf05b548a750e61ef2417fc15edbc64/test/case.rb#L86-L87