Sha256: 957f4c275600ddaf83606e6ffa44907edabe9abe9176576e0a6bf45fee7fe0ba

Contents?: true

Size: 722 Bytes

Versions: 26

Compression:

Stored size: 722 Bytes

Contents

require File.expand_path("../../spec_helper", __FILE__)

describe "Friendly" do
  describe "configuring friendly" do
    before do
      @datastore = stub
      Friendly::DataStore.stubs(:new).returns(@datastore)
      @db = stub(:meta_def => nil)
      Sequel.stubs(:connect).returns(@db)
      Friendly.configure(:host => "localhost")
    end

    it "creates a db object by delegating to Sequel" do
      Sequel.should have_received(:connect).with(:host => "localhost")
    end

    it "creates a datastore object with the db object" do
      Friendly::DataStore.should have_received(:new).with(@db)
    end

    it "sets the datastore as the default" do
      Friendly.datastore.should == @datastore
    end
  end
end

Version data entries

26 entries across 26 versions & 7 rubygems

Version Path
ihoka-friendly-0.8.0.pre spec/unit/friendly_spec.rb
ihoka-friendly-0.7.1.2 spec/unit/friendly_spec.rb
ihoka-friendly-0.7.1.1 spec/unit/friendly_spec.rb
ihoka-friendly-0.7.1 spec/unit/friendly_spec.rb
ihoka-friendly-0.7.0 spec/unit/friendly_spec.rb
friendly-0.6.0 spec/unit/friendly_spec.rb
honkster-friendly-0.5.3 spec/unit/friendly_spec.rb
honkster-friendly-0.5.2 spec/unit/friendly_spec.rb
honkster-friendly-0.5.1 spec/unit/friendly_spec.rb
wayne-friendly-0.5.1 spec/unit/friendly_spec.rb
wego-friendly-0.5.1 spec/unit/friendly_spec.rb
arunthampi-friendly-0.5.1 spec/unit/friendly_spec.rb
friendly_postgres-0.5.1 spec/unit/friendly_spec.rb
friendly-0.5.1 spec/unit/friendly_spec.rb
friendly-0.5.0 spec/unit/friendly_spec.rb
friendly_postgres-0.4.5 spec/unit/friendly_spec.rb
friendly-0.4.5 spec/unit/friendly_spec.rb
friendly-0.4.4 spec/unit/friendly_spec.rb
friendly_postgres-0.4.3 spec/unit/friendly_spec.rb
friendly-0.4.3 spec/unit/friendly_spec.rb