Sha256: dc0d1e08934c23df520f916119e2275c19f713505d2291dd28d2bcee3d02867b

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe "Initializing a processor's failure chain" do
  subject { chain.call(request) }

  let(:env) {
    Environment.build {
      register :evaluate, Processor::Evaluator
      register :wrap,     Processor::Wrapper
    }
  }

  let(:chain) {
    env.chain {
      evaluate(Spec::Handler::Evaluator) {
        wrap Spec::Presenter
      }
    }
  }

  let(:request) { Request.new(app_env, input) }
  let(:app_env) { double }
  let(:input)   { :invalid }

  let(:response) { Response::Failure.new(request, Spec::Presenter.new(:failure)) }

  it { should eql(response) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
substation-0.0.10.beta2 spec/unit/substation/chain/dsl/builder/failure_chain_spec.rb