Parent

VCR::CucumberTags

Public Class Methods

add_tag(tag) click to toggle source
# File lib/vcr/test_frameworks/cucumber.rb, line 8
def add_tag(tag)
  @tags << tag
end
new(main_object) click to toggle source
# File lib/vcr/test_frameworks/cucumber.rb, line 14
def initialize(main_object)
  @main_object = main_object
end
tags() click to toggle source
# File lib/vcr/test_frameworks/cucumber.rb, line 4
def tags
  @tags.dup
end

Public Instance Methods

tag(*tag_names) click to toggle source
Alias for: tags
tags(*tag_names) click to toggle source
# File lib/vcr/test_frameworks/cucumber.rb, line 18
def tags(*tag_names)
  options = tag_names.last.is_a?(::Hash) ? tag_names.pop : {}
  tag_names.each do |tag_name|
    tag_name = "@#{tag_name}" unless tag_name =~ /^@/
    cassette_name = "cucumber_tags/#{tag_name.gsub(/\A@/, '')}"

    # It would be nice to use an Around hook here, but
    # cucumber has a bug: background steps do not run
    # within an around hook.
    # https://gist.github.com/652968
    @main_object.Before(tag_name) do
      VCR.insert_cassette(cassette_name, options)
    end

    @main_object.After(tag_name) do
      VCR.eject_cassette
    end

    self.class.add_tag(tag_name)
  end
end
Also aliased as: tag

[Validate]

Generated with the Darkfish Rdoc Generator 2.