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_matches(self): self.assertTrue(JasmineCoffeeTestFile.matches("atlas/spec/javascripts/charlie_spec.coffee")) self.assertFalse(JasmineCoffeeTestFile.matches("arthur/scargill/loves/his.espresso"))