Browse files

Added support for switching from a _steps file back to the feature file.

  • Loading branch information...
1 parent 821f129 commit e393c0258adf4956920c37e65f63c6b5c1887d61 @davebrace davebrace committed Apr 15, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 run_ruby_test.py
View
6 run_ruby_test.py
@@ -246,6 +246,10 @@ class HamlFile(BaseFile):
def possible_alternate_files(self): return [self.file_name.replace(".haml", ".haml_spec.rb")]
def features(self): return ["switch_to_test"]
+ class CucumberStepsFile(BaseFile):
+ def possible_alternate_files(self): return [self.file_name.replace("_steps.rb", ".feature")]
+ def features(self): return ["switch_to_test"]
+
def find_partition_folder(self, file_name, default_partition_folder):
folders = self.view.window().folders()
for folder in folders:
@@ -266,6 +270,8 @@ def file_type(self, file_name = None):
elif re.search('\w+\.feature', file_name):
partition_folder = self.find_partition_folder(file_name, CUCUMBER_UNIT_FOLDER)
return BaseRubyTask.CucumberFile(file_name, partition_folder)
+ elif re.search('\w+\_steps.rb', file_name):
+ return BaseRubyTask.CucumberStepsFile(file_name)
elif re.search('\w+\.rb', file_name):
return BaseRubyTask.RubyFile(file_name)
elif re.search('\w+\.erb', file_name):

0 comments on commit e393c02

Please sign in to comment.