Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 34 lines (28 sloc) 0.688 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
require 'helper'

describe Toy do
  uses_constants('User', 'Game')

  describe ".logger" do
    before do
      @logger = Toy.logger
    end

    after do
      Toy.logger = @logger
    end

    it "should set the default logger" do
      logger = stub
      Toy.logger = logger
      Toy.logger.should == logger
    end
  end

  describe ".key_factory" do
    it "should set the default key_factory" do
      key_factory = stub
      Toy.key_factory = key_factory
      Toy.key_factory.should == key_factory
    end

    it "should default to the UUIDKeyFactory" do
      Toy.key_factory = nil
      Toy.key_factory.should be_instance_of(Toy::Identity::UUIDKeyFactory)
    end
  end
end
Something went wrong with that request. Please try again.