Sha256: 2d4bfc7c22301bf148bcb7e221dfac0f4be7840ecee152cc5cbf4fdaa9a1fd5a
Contents?: true
Size: 1.36 KB
Versions: 2
Compression:
Stored size: 1.36 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 # This is the docstring passed to the <tt>it()</tt> method or any # of its aliases attr_reader :description # Internal use only - used to store options to pass to example # when it is initialized attr_reader :options # :nodoc: # 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rspec-1.2.3 | lib/spec/example/example_proxy.rb |
rspec-1.2.4 | lib/spec/example/example_proxy.rb |