Sha256: b878159a8832fbf03edf4590818a5312a31c045170f17d36142ac7447372a1ff

Contents?: true

Size: 666 Bytes

Versions: 7

Compression:

Stored size: 666 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module Adhearsion
  class Router
    describe EventedRoute do
      let(:name) { 'catchall' }

      subject { Route.new name }

      before { subject.extend described_class }

      it { should be_evented }

      describe "dispatching a call" do
        let(:call) { Call.new }

        context "via a block" do
          subject :route do
            Route.new 'foobar' do |c|
              c.foo
            end
          end

          it "should yield the call to the block" do
            flexmock(call).should_receive(:foo).once
            route.dispatch call
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adhearsion-2.3.0 spec/adhearsion/router/evented_route_spec.rb
adhearsion-2.2.1 spec/adhearsion/router/evented_route_spec.rb
adhearsion-2.2.0 spec/adhearsion/router/evented_route_spec.rb
adhearsion-2.1.3 spec/adhearsion/router/evented_route_spec.rb
adhearsion-2.1.2 spec/adhearsion/router/evented_route_spec.rb
adhearsion-2.1.1 spec/adhearsion/router/evented_route_spec.rb
adhearsion-2.1.0 spec/adhearsion/router/evented_route_spec.rb