Sha256: 8057a18122fd729bd02b7e5bcdcea9543941e64d966455fca6144dc92bce6d44
Contents?: true
Size: 938 Bytes
Versions: 1
Compression:
Stored size: 938 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Utils, '.coerce_callable' do subject { described_class.coerce_callable(handler) } context "with a String handler" do let(:handler) { 'Spec::Action::Success' } it { should be(Spec::Action::Success) } end context "with a Symbol handler" do let(:handler) { :'Spec::Action::Success' } it { should be(Spec::Action::Success) } end context "with a const handler" do let(:handler) { Spec::Action::Success } it { should be(Spec::Action::Success) } end context "with a Proc handler" do let(:handler) { Proc.new { |response| respone } } it { should be(handler) } end context "with a Chain handler" do let(:handler) { Chain.new([]) } it { should be(handler) } end context "with an unsupported handler" do let(:handler) { double } specify do expect { subject }.to raise_error(ArgumentError) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
substation-0.0.10.beta2 | spec/unit/substation/utils/class_methods/coerce_callable_spec.rb |