# File lib/vcr/test_frameworks/cucumber.rb, line 30
    def tags(*tag_names)
      original_options = tag_names.last.is_a?(::Hash) ? tag_names.pop : {}
      tag_names.each do |tag_name|
        tag_name = "@#{tag_name}" unless tag_name =~ /\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 |scenario|
          options = original_options.dup

          cassette_name = if options.delete(:use_scenario_name)
            if scenario.respond_to?(:outline?) && scenario.outline?
              ScenarioNameBuilder.new(scenario).cassette_name
            elsif scenario.respond_to?(:scenario_outline)
              [ scenario.scenario_outline.feature.name.split("\n").first,
                scenario.scenario_outline.name,
                scenario.name.split("\n").first
              ].join("/")
            else
              [ scenario.feature.name.split("\n").first,
                scenario.name.split("\n").first
              ].join("/")
            end
          else
            "cucumber_tags/#{tag_name.gsub(/\A@/, '')}"
          end

          VCR.insert_cassette(cassette_name, options)
        end

        @main_object.After(tag_name) do |scenario|
          VCR.eject_cassette(:skip_no_unused_interactions_assertion => scenario.failed?)
        end

        self.class.add_tag(tag_name)
      end
    end