Module: RSpecGherkin

Extended by:
RSpecGherkin
Included in:
RSpecGherkin
Defined in:
lib/rspec-gherkin.rb,
lib/rspec-gherkin/builder.rb,
lib/rspec-gherkin/version.rb,
lib/rspec-gherkin/rspec-dsl.rb,
lib/rspec-gherkin/rspec-loader.rb

Defined Under Namespace

Modules: DSL, RSpec Classes: Ambiguous, Builder, Malformed, Pending

Constant Summary collapse

VERSION =
"0.1.2"

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.featuresObject

Returns the value of attribute features.



9
10
11
# File 'lib/rspec-gherkin.rb', line 9

def features
  @features
end

Instance Method Details

#feature?(path) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rspec-gherkin.rb', line 16

def feature?(path)
  !!path.match(mask_to_pattern(feature_mask))
end

#feature_spec?(path) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/rspec-gherkin.rb', line 20

def feature_spec?(path)
  !!path.match(mask_to_pattern(spec_mask))
end

#feature_to_spec(path, prefix = true) ⇒ Object



24
25
26
27
# File 'lib/rspec-gherkin.rb', line 24

def feature_to_spec(path, prefix = true)
  path = path.match(mask_to_pattern(feature_mask))[0] unless prefix
  path.sub(mask_to_pattern(feature_mask), mask_to_replacement(spec_mask))
end

#spec_to_feature(path, prefix = true) ⇒ Object



29
30
31
32
# File 'lib/rspec-gherkin.rb', line 29

def spec_to_feature(path, prefix = true)
  path = path.match(mask_to_pattern(spec_mask))[0] unless prefix
  path.sub(mask_to_pattern(spec_mask), mask_to_replacement(feature_mask))
end