Sha256: 9c159b5c0edf382a1bb64039665ae643da9fd5773cefbe2e0382513d0db15f5c

Contents?: true

Size: 927 Bytes

Versions: 2

Compression:

Stored size: 927 Bytes

Contents

require "spec_helper"

# Here's we're testing the basics of the module itself,
# the variable that you can set, the actions you can take, etc.

describe "TheBigDB module" do
  it "has accessors for common used global variables" do
    TheBigDB.api_host = "foobar"
    TheBigDB.api_port = 1337
    TheBigDB.api_version = "1337"

    TheBigDB.api_host.should == "foobar"
    TheBigDB.api_port.should == 1337
    TheBigDB.api_version.should == "1337"
  end

  it "has resettable default values" do
    default_host = TheBigDB.api_host.dup
    TheBigDB.api_host = "foobar"
    TheBigDB.reset_default_configuration
    TheBigDB.api_host.should == default_host
  end

  it "can set a configuration scope" do
    TheBigDB.api_host = "thebigdb_host_1"
    TheBigDB.with_configuration(api_host: "thebigdb_host_2") do
      TheBigDB.api_host.should == "thebigdb_host_2"
    end
    TheBigDB.api_host.should == "thebigdb_host_1"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thebigdb-1.2.0 spec/thebigdb_spec.rb
thebigdb-1.1.0 spec/thebigdb_spec.rb