Sha256: eb1b33f96c8ec25d8a622f4f2911f88dddb7f8fb2c0093053658429e9a5cdfe8

Contents?: true

Size: 797 Bytes

Versions: 18

Compression:

Stored size: 797 Bytes

Contents

require "spec_helper"

describe Ruboty::Robot do
  let(:instance) do
    described_class.new(options)
  end

  let(:options) do
    {}
  end

  describe "#brain" do
    context "without any Brain class" do
      it "returns a Ruboty::Brains::Memory" do
        instance.brain.should be_a Ruboty::Brains::Memory
      end

      it "can be used as a Hash object" do
        instance.brain.data["a"] = 1
        instance.brain.data["a"].should == 1
      end
    end

    context "with another Brain class" do
      after do
        Ruboty::Brains::Base.brain_classes.pop
      end

      let!(:another_brain_class) do
        Class.new(Ruboty::Brains::Base)
      end

      it "returns its instance as a Brain" do
        instance.brain.should be_a another_brain_class
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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