Sha256: b5dcedd5e0f68335c8a84f7da9e4db58b029806203735e5cac39c2c7e00cdf4f

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

module RSpec
  module Specify
    module SharedSteps
      def shared_steps(name, &block)
        ensure_shared_example_steps_name_not_taken(name)
        ::RSpec.world.shared_example_steps[name] = block
      end

      private

      def ensure_shared_example_steps_name_not_taken(name)
        return unless ::RSpec.world.shared_example_steps.key?(name)

        raise(ArgumentError, "Shared step '#{name}' already exists")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
specify-1.0.0 lib/specify/rspec/shared_steps.rb