Skip to content
gdelfino edited this page Jan 31, 2011 · 13 revisions

Q: My step definitions are not being included when I have my features in subdirectories.

A: The bundle runs the selected feature directly. Meaning, if you try to run features/topic/awesomeness.feature then the bundle will just run cucumber --format=html features/topic/awesomeness.feature. The problem with this is that the support files and step definiton files are not in the topic subdir. To change the behavior of the bundle and how it runs the features do the following:

  • Go to preferences..
  • Click on Advanced.
  • Click on Shell Variables.
  • Enter new one:
    • Variable: TM_CUCUMBER_OPTS
    • Value: --format=html -r features

Doing this will ensure that every ruby file in the features dir and subdirs will be loaded.

Q: The following error occurs when Run Feature is selected in TextMate and a feature file is open: /Applications/TextMate.app/Contents/SharedSupport/Bundles/Cucumber.tmbundle/Support/lib/cucumber/mate/../mate.rb:3:in `require’: No such file to load—rubygems (LoadError)

The Rspec bundle loaded and it works fine in TextMate. I have the Cucumber bundle also loaded into the /Applications/TextMate.app bundles folder as above under Mac OS 10.4. My ruby and other gems are in /usr/local/lib/ruby. Cucumber gems (0.2.3, 0.2.2) are installed. When I had just 0.2.2 or 0.2.3 installed, the same error occurred. And the command line execution of cucumber seems to be ok.

TM_RSPEC_HOME and TM_CUCUMBER_OPTS shell variables are set. Explicit path references and a ~/.MacOSX/environment.plist path to /usr/local/lib/ruby have been entered but without success.

Rails 2.1 and Rails 2.2 apps can run the cucumber features -n command in either app produces the correct response. But in neither app will the cucumber bundle Run Feature work. The editing constructs seem to work fine. In either app the Rspec bundle executes fine.

Can you provide some extra instruction?

A: I think it is possible you are using an old version of TextMate and there is no ui.rb file in the TextMate shared support path. Try upgrading to TextMate 1.5.8, which solved this issue for me.

Q: I want to differentiate .feature files in TextMate from other plain text files

A: You can do this by associating an icon with the .feature file extension. Follow these steps:

  • Copy any 16×16 TIFF to /Applications/TextMate.app/Contents/Resources/File Icons but call it PBX-feature-Icon.TIFF. For example, you could use the 16×16 version of the official logo.
  • Edit the Bindings.plist in that folder to include:

<key>PBX-feature-Icon</key>
<array>
  <string>feature</string>
</array>
  • Relaunch TextMate and view with delight a suitable icon for all feature files
Clone this wiki locally