Sha256: 5b2a38c0ed1bda914c177cbac81c1c1221fd48b365625731d5d9463120ca921c

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Configuration" do
  describe "Config" do
    before(:each) do
      @config_yml = {
        "config" => {
          "username" => "captmal",
          "password" => "iluvinara",
          "growl" => true
        }
      }
      YAML.stub!(:load_file).and_return(@config_yml)
      @config = YMDP::Configuration::Config.new
    end
    
    it "should return username" do
      @config.username.should == @config_yml["config"]["username"]
    end
    
    it "should return password" do
      @config.password.should == @config_yml["config"]["password"]
    end
    
    it "should return growl" do
      @config.growl?.should == @config_yml["config"]["growl"]
    end
    
    describe "[]" do
      it "should return username" do
        @config["username"].should == @config_yml["config"]["username"]
      end
    
      it "should return password" do
        @config["password"].should == @config_yml["config"]["password"]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ymdp-0.1.6 spec/configuration_spec.rb
ymdp-0.1.4 spec/configuration_spec.rb
ymdp-0.1.3.2 spec/configuration_spec.rb
ymdp-0.1.3.1 spec/configuration_spec.rb
ymdp-0.1.3 spec/configuration_spec.rb