Sha256: 3d6dc592e76eaeda4a4087cb8a84d21f8bdd43ea43305da358fc4c3348da8494

Contents?: true

Size: 601 Bytes

Versions: 34

Compression:

Stored size: 601 Bytes

Contents

module Spec
  module Example
    module ArgsAndOptions
      def args_and_options(*args) # :nodoc:
        options = Hash === args.last ? args.pop : {}
        return args, options
      end

      def add_options(args, options={}) # :nodoc:
        args << {} unless Hash === args.last
        args.extend WithOptions
        args.options.merge!(options)
        args.options
      end

      def set_location(options, location) # :nodoc:
        options[:location] ||= location
      end

      module WithOptions # :nodoc:
        def options
          last
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 lib/spec/example/args_and_options.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/lib/spec/example/args_and_options.rb
rspec-1.3.2 lib/spec/example/args_and_options.rb
rspec-1.3.1 lib/spec/example/args_and_options.rb
rspec-1.3.1.rc lib/spec/example/args_and_options.rb
rspec-1.3.0 lib/spec/example/args_and_options.rb
hubbub-0.0.11 lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb
hubbub-0.0.10 lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb
hubbub-0.0.9 lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb
hubbub-0.0.8 lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb
hubbub-0.0.6 lib/vendor/plugins/rspec/lib/spec/example/args_and_options.rb
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/lib/spec/example/args_and_options.rb
media-path-0.1.2 vendor/rspec/lib/spec/example/args_and_options.rb
simple-templater-0.0.1.3 vendor/rspec/lib/spec/example/args_and_options.rb
pupu-0.0.2.pre vendor/rspec/lib/spec/example/args_and_options.rb
media-path-0.1.1.pre vendor/rspec/lib/spec/example/args_and_options.rb
simple-templater-0.0.1.2 vendor/rspec/lib/spec/example/args_and_options.rb
media-path-0.1.1 vendor/rspec/lib/spec/example/args_and_options.rb
simple-templater-0.0.1.1 vendor/rspec/lib/spec/example/args_and_options.rb
pupu-0.0.2 vendor/rspec/lib/spec/example/args_and_options.rb