Sha256: 4d9c1cc62171618008f7ba7ffedffcbd6671fb31e6dee3a77ea4a226611c9cbc

Contents?: true

Size: 1.28 KB

Versions: 34

Compression:

Stored size: 1.28 KB

Contents

module Spec
  module Example
    # Lightweight proxy for an example. This is the object that is passed to
    # example-related methods in Spec::Runner::Formatter::BaseFormatter
    class ExampleProxy

      def initialize(description=nil, options={}, location=nil) # :nodoc:
        @description, @options, @location = description, options, location
      end

      # Optional hash passed to the example declaration
      attr_reader :options

      # This is the docstring passed to the <tt>it()</tt> method or any
      # of its aliases
      attr_reader :description

      # The file and line number at which the represented example
      # was declared. This is extracted from <tt>caller</tt>, and is therefore
      # formatted as an individual line in a backtrace.
      attr_reader :location

      # Deprecated - use location()
      def backtrace
        Spec.deprecate("ExampleProxy#backtrace","ExampleProxy#location")
        location
      end

      # Convenience method for example group - updates the value of
      # <tt>description</tt> and returns self.
      def update(description) # :nodoc:
        @description = description
        self
      end

      def ==(other) # :nodoc:
        (other.description == description) & (other.location == location)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 11 rubygems

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