Top Level Namespace

Defined Under Namespace

Modules: Yari

Class Method Summary collapse

Class Method Details

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

Raises:

  • (ArgumentError)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/yari/yari_dsl.rb', line 2

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

   = ::RSpec.configuration..merge()
  matching_feature = find_feature(name)
  [:feature_name]= name

  if matching_feature
    if matching_feature.tags.include?('@updated')
      pending_feature(name, , block.source_location,
                      "Feature has been marked as updated\n \t# Update specs for this feature and remove the @updated tag\n \t# 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