drnic / cucumber-tmbundle forked from bmabey/cucumber-tmbundle

TextMate bundle for Cucumber - fork of RSpec Story Runner bundle

This URL has Read+Write access

Dr Nic Williams and Ryan Bigg (author)
Thu Oct 29 17:09:06 -0700 2009
commit  6066d3a99e26a13e39e953f7d59aaf9fe06b8c1f
tree    3874d016cf8f1d552d587738999e76f3250b5300
parent  621a0b17e0e49aee9d10d7a5717b5fd458d8c3d8
name age message
file .gitignore Fri Jan 09 10:09:45 -0800 2009 credit [bmabey]
directory Commands/ Sun Sep 27 19:13:28 -0700 2009 read as array instead of string [darrinholst]
file MIT-LICENSE.txt Thu Jan 22 07:42:55 -0800 2009 license [bmabey]
directory Preferences/ Wed Mar 11 02:28:03 -0700 2009 Symbol lists for Step files [drnic]
file README.textile Wed Jun 17 09:17:37 -0700 2009 sync'd the the plaintext language syntax erb te... [timcharper]
file Rakefile Fri Apr 17 19:02:22 -0700 2009 root rake file.. runcoderun.. [bmabey]
directory Snippets/ Thu Oct 29 17:09:06 -0700 2009 Added a 'cuke' snippet to create the Cucumber(<... [Dr Nic Williams and Ryan Bigg]
directory Support/ Mon Oct 05 12:15:16 -0700 2009 Merge branch 'master' of git://github.com/darri... [drnic]
directory Syntaxes/ Thu Oct 29 17:09:06 -0700 2009 Added a 'cuke' snippet to create the Cucumber(<... [Dr Nic Williams and Ryan Bigg]
directory color_themes/ Tue Dec 09 02:53:40 -0800 2008 Add support for Scenario Outline [josephwilk]
file info.plist Thu Oct 29 17:09:06 -0700 2009 Added a 'cuke' snippet to create the Cucumber(<... [Dr Nic Williams and Ryan Bigg]
README.textile

Textmate Bundle for Cucumber

This is a fork of the rspec-story-tmbundle.
The goal is to keep the same functionality that the original bundle had but make it compatible with Cucumber and also take advantage of the benefits that Cucumber offers.

So far the basic file switching and syntax highlighting is working. You can also run a feature. (See below.)
File creation and more advanced step generation commands have not yet been ported fully. Feel free to help out. :)

If you are doing ruby development with webrat you may also want the webrat bundle.

Bundle Features:

  • Color highlighting for plain text features (supports all the languages that Cucumber does)
  • Snippets for plain text features and step files.
  • Auto-completion of steps in features (Alt+Escape)
  • Predefined completions (escape key) for common feature keywords.
  • Spellchecking turned on by default for the plain text features.
  • Switch between plain text feature and corresponding step matcher file. Shft+Ctrl+Down
  • Choose to go any file of opposite kind (step <→ feature) Shft+Ctrl+Up
  • Run a feature with HTML output.
  • Run a single scenario with HTML output.

TODO:

  • Add Textmate formatter with a clickable backtrace.
  • Rethink Alternative-File Command to avoid encouraging feature coupled steps.
  • Background support (the new feature in Cucumber.)
  • Syntax Highlighting for multistrings.(""")
  • Navigation Commands
    • Goto step definition from feature file. (just need to implement StepDetector.)
    • From a step definition be able to pull up a list of features using that step and to jump to them.
  • Automatically create template step file with pending steps based on the steps used in the feature.
    • Use Cucumber’s built in functionality to do this and clean out the story bundle’s way.
  • Snippets for tables.
  • Multi-language support for the snippets?

Installation

mkdir -p ~/Library/Application\ Support/TextMate/Bundles/
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/bmabey/cucumber-tmbundle.git Cucumber.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'
  • In TextMate: From your drop down menu, select Bundles → Bundle Editor → Reload Bundles.
  • To install the color themes for the syntax highlighting:
    • Click on the themes found in the color_themes dir by clicking on them in Finder.

Migrating from RSpec Story Runner Bundle

To avoid file detection collisions with the RSpec Story bundle I would suggest you turn it off when using the Cucumber bundle and vice-versa. You can do this by clicking on the ‘Filter List’ button in the Bundle Editor section of Textmate.
(Warning: Switching to the Cucumber color themes will clobber the Story runner color themes when you reinstall the theme.)

Updating

Update your bundle by running the “Update Cucumber Bundle” command. (Thanks to Tim Harper for this.)

Running Features

The bundle uses the ‘cucumber’ command by default to run the features. If you have a “script/cucumber” located in youre project (i.e. you’re using cucumber as a rails plugin) it will use that local version instead. You may override the default running options a number of ways. To change them globally you can set a TM_CUCUMBER_OPTS variable in textmate.

If you have cucumber profiles defined in your cucumber.yml file you can direct the bundle to run a certain feature with that profile by annotating the feature with a comment like so:

  1. profile watir

The above annotation would run “cucumber file.feature —profile watir”.

To run a feature with a cucumber rake task instead of the cucumber command you may similarly annotate the feature directing which task to use:

  1. rake features:watir

Rake is generally loads slower than the stand-alone cucumber command so this option is not the recommend.

Switching Between Features and Step files

The file switching relies on the following directory structure convention:


Basic features (no sub-directories):

/project_root/features |- basic_feature.feature (extension must be .feature) |- support |- env.rb |- step_definitions |- basic_feature_steps.rb Using feature sub-directories: /project_root/features |- feature_one | |- some_feature.feature | |- step_definitions | |- some_feature_steps.rb | |- feature_two | …..

These directory structures can be used together (basic features can reside in the root features directory, and feature sets can be put in sub directories).

Credits

The Cucumber TM Bundle is currently be maintained by Ben Mabey and Dr. Nic.

  • Ben Mabey – Author/Main contributor (stuff)
  • Dr. Nic – Main contributor (Snippet and grammar updates, updated ‘Run Focused Scenario’ command, Autocomplete Step command, Scenario Folding, Choose Alternate File, and more stuff)
  • John Thornton – Co-Author of original RSpec Story Runner Bundle
  • Andre FoekenOriginal color syntax highlighting
  • Tim Harper – Update Bundle Command, file detection bug fixes, go to step definition fixes, step grammer enhancements.
  • Aslak Hellesøy – Rake task improvement, snippet updates, Cucumber!
  • Pedro Visintin – Syntax fix
  • Joseph Wilk – Syntax extentions for ‘Scenario Outline’
  • Sam Livingston-Gray – Align Table Cells command
  • Grant Hollingworth – Improved step grammar – regexps syntax highlighting, more precise string and comment scopes. Ignore includes for step completion.
  • Ben Wiseley – Fix for FileUtils bug
  • Ashley Moran – Improved Align Table Cells command
  • Jari Bakken – Syntax Highlighting improvements, include support for @tags.
  • Chris Hoffman – Improved Step Definition grammar to handle string interpolation when calling other steps.