Looking at the specs it seemed like there were some missing test cases, and some superfluous test cases.
This PR adds in test coverage for the scenarios where the context is currently a spec file, and deletes some test cases which refer to variables not actually used in the code.
Arguably the tests which assert that variables are set (e.g. Expect Ref("s:last_spec_file") == "controller_spec.rb") are testing implementation details rather than behaviour.
An alternative way of writing this would be to have integration tests which e.g. assert that if RunLastSpec is called after RunCurrentTestFile then the correct file gets run.
This is my first attempt at writing vspec tests, so please let me know if the style isn't right.
Looking at the specs it seemed like there were some missing test cases, and some superfluous test cases.
This PR adds in test coverage for the scenarios where the context is currently a spec file, and deletes some test cases which refer to variables not actually used in the code.
Arguably the tests which assert that variables are set (e.g.
Expect Ref("s:last_spec_file") == "controller_spec.rb"
) are testing implementation details rather than behaviour.An alternative way of writing this would be to have integration tests which e.g. assert that if RunLastSpec is called after RunCurrentTestFile then the correct file gets run.
This is my first attempt at writing vspec tests, so please let me know if the style isn't right.