def current_test(self): file_path = self.config["file_path"] if JasmineCoffeeTestFile.matches(file_path): return JasmineCoffeeTestFile(self.config) if CucumberTestFile.matches(file_path): return CucumberTestFile(self.config) if RSpecTestFile.matches(file_path, self.config["rspec_regex"]): return RSpecTestFile(self.config) return UnknownTestFile(self.config)
def test_path_to_related_test_file(self): config = get_config() config["root_directory"] = fixture_path() config["file_path"] = "antelope.rb" test = RSpecTestFile(config) self.assertEqual(test.path_to_test_file(), fixture_path()+"/spec/model/antelope_spec.rb")
def test_matches(self): self.assertTrue(RSpecTestFile.matches("spics/and/specs_spec.rb", get_config()))