Sha256: d10cfa4e1d57d39bab6384e412bcd8f626c0e4c1c2697f81dcc4a62159587011

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

describe MooMoo::Config do
  before :each do
    @config = MooMoo::Config.new
  end

  it { @config.should have_attr_accessor :host }
  it { @config.should have_attr_accessor :key  }
  it { @config.should have_attr_accessor :user }
  it { @config.should have_attr_accessor :pass }
  it { @config.should have_attr_accessor :port }

  describe "default configuration" do
    before :each do
      File.should_receive(:exists?).with(".moomoo.yml").and_return(true)
      File.should_receive(:open).with(".moomoo.yml").and_return(
        "
        host: thehost
        key: thekey
        user: theuser
        pass: thepass
        port: theport
        "
      )

      @config = MooMoo::Config.new
    end

    it "should set default host from default options file" do
      @config.host.should == "thehost"
    end

    it "should set default key from default options file" do
      @config.key.should == "thekey"
    end

    it "should set default user from default options file" do
      @config.user.should == "theuser"
    end

    it "should set default pass from default options file" do
      @config.pass.should == "thepass"
    end

    it "should set default port from default options file" do
      @config.port.should == "theport"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moo_moo-0.2.0 spec/moo_moo/config_spec.rb