Sha256: f7c37389034ccfda13e57251128258ede45586e6180aff4cd06cfb32867def69

Contents?: true

Size: 559 Bytes

Versions: 7

Compression:

Stored size: 559 Bytes

Contents

module Spec
  module Runner
    class ExecutionContext
      module InstanceMethods
        def initialize(spec)
          @spec = spec
        end
        
        def mock(name, options={})
          mock = Api::Mock.new(name, options)
          @spec.add_mock(mock)
          mock
        end

        def duck_type(*args)
          return Api::DuckTypeArgConstraint.new(*args)
        end

        def violated(message="")
          raise Spec::Api::ExpectationNotMetError.new(message)
        end
      end
      include InstanceMethods
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rspec-0.5.15 lib/spec/runner/execution_context.rb
rspec-0.5.14 lib/spec/runner/execution_context.rb
rspec-0.5.16 lib/spec/runner/execution_context.rb
rspec-0.6.1 lib/spec/runner/execution_context.rb
rspec-0.6.3 lib/spec/runner/execution_context.rb
rspec-0.6.0 lib/spec/runner/execution_context.rb
rspec-0.6.2 lib/spec/runner/execution_context.rb