Sha256: 810e40febc40b4db8c227c85468f295b80fa36c553f3b611a2d5afbf788043a1

Contents?: true

Size: 796 Bytes

Versions: 18

Compression:

Stored size: 796 Bytes

Contents

require "spec_helper"

describe Ruboty::AdapterBuilder do
  let(:builder) do
    described_class.new(robot)
  end

  let(:robot) do
    Ruboty::Robot.new
  end

  describe "#build" do
    context "with no other adapter class definition" do
      it "returns a Ruboty::Adapters::Shell as a default adapter" do
        builder.build.should be_a Ruboty::Adapters::Shell
      end
    end

    context "with another adapter class definition" do
      after do
        Ruboty::AdapterBuilder.adapter_classes.pop
      end

      let!(:another_adapter_class) do
        Class.new(Ruboty::Adapters::Base) do
          def run
          end
        end
      end

      it "returns an instance of that adapter class" do
        builder.build.should be_a another_adapter_class
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ruboty-1.2.2 spec/ruboty/adapter_builder_spec.rb
ruboty-1.2.1 spec/ruboty/adapter_builder_spec.rb
ruboty-1.2.0 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.9 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.8 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.7 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.6 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.5 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.4 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.3 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.2 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.1 spec/ruboty/adapter_builder_spec.rb
ruboty-1.1.0 spec/ruboty/adapter_builder_spec.rb
ruboty-1.0.4 spec/ruboty/adapter_builder_spec.rb
ruboty-1.0.3 spec/ruboty/adapter_builder_spec.rb
ruboty-1.0.2 spec/ruboty/adapter_builder_spec.rb
ruboty-1.0.1 spec/ruboty/adapter_builder_spec.rb
ruboty-1.0.0 spec/ruboty/adapter_builder_spec.rb