title: Cucumber Features and Step Definitions
body: <p>I am new to Cucumber testing.</p>
  
  <p>I have created two features files:</p>
  
  <pre><code>events.feature
  partner.feature
  </code></pre>
  
  <p>and have my step definitions in a step_definitions folder:</p>
  
  <pre><code>./step_definitions/
       events.rb
       partner.rb
  </code></pre>
  
  <p>It seems that Cucumber looks in all the .rb files for the step information.</p>
  
  <p>Is there anyway of restricting the feature to look at a specific step definition file?</p>
  
  <p>The reason as to why I want to do this, is because I am getting Ambiguous match errors, even when I use the --guess flag.</p>
  
  <p>The reason as to why I want to do this is for the following reasons.  I am testing a CMS, and want to test each of the different content types (events &amp; partners) in separate features.</p>
  
  <p>events.feature</p>
  
  <pre><code>Feature: Add partner
    As an administrator I can add a new partner
  
    Scenario: Create partner
      Given I am logged in
      When I create a partner
      Then I should see content
  </code></pre>
  
  <p>partner.feature</p>
  
  <pre><code>Feature: Add event
    As an administrator I can add a new event
  
    Scenario: Create event
      Given I am logged in
      When I create an event
      Then I should see content
  </code></pre>
  
  <p>Just focusing on the 'then I should see content' which is in both scenarios, the error occurs because in the .rb files I need to include:</p>
  
  <p>partners.rb</p>
  
  <pre><code>Then /^I should see content$/ do
    BROWSER.html.should include('SOME PARTNER CONTENT')
  end
  </code></pre>
  
  <p>events.rb</p>
  
  <pre><code>Then /^I should see content$/ do
    BROWSER.html.should include('SOME EVENT CONTENT')
  end
  </code></pre>
  
  <p>which means there is an Ambiguous match of "I should see content".</p>
  
  <p>I understand there are different ways of structuring this, i.e. I could create a content feature, and use scenario outlines:</p>
  
  <pre><code>Feature: Add content
    As an administrator I can add a new content
  
    Scenario Outline: Create content
      Given I am logged in
      When I create an &lt;content type&gt;
      Then I should see &lt;example content&gt;
  
      Examples: 
      |event   |March Event | 
      |partner |Joe Blogs   | 
  </code></pre>
  
  <p>But I don't want to do this because I want to encapsulate each content type in their own test feature.</p>
  
  <p>So essentially I need to work out how to run specific step files according to the feature I am testing.</p>