Top Level Namespace

Defined Under Namespace

Modules: RSpecGherkin

Class Method Summary collapse

Class Method Details

.feature(name = nil, new_metadata = {}, &block) ⇒ Object

Raises:

  • (ArgumentError)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rspec-gherkin/rspec-dsl.rb', line 4

def feature(name = nil,  = {}, &block)
  raise ArgumentError.new("requires a name") if name.nil?

   = ::RSpec.configuration..merge()
  matching_feature = find_feature(name)

  if matching_feature
    if matching_feature.tags.include?('updated')
      pending_feature(name, , block.source_location, [
        "Feature has been marked as updated",
        "Update specs for this feature and remove the @updated tag",
        "Feature file: '#{feature_path(block.source_location)}'"
      ])
    else
      describe("Feature: #{name}", .merge(:current_feature => matching_feature), &block)
    end
  else
    pending_feature(name, , block.source_location,
      "No such feature in '#{feature_path(block.source_location)}'"
    )
  end
end