Sha256: 504d0f58b14f5d3b4fc4b1145e2edbbc433e433df54a94de39eb5cc67e88c6d0

Contents?: true

Size: 1.27 KB

Versions: 15

Compression:

Stored size: 1.27 KB

Contents

# Copyright (C) 2011-2012 RightScale, Inc, All Rights Reserved Worldwide.
#
# THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
# AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
# reproduction, modification, or disclosure of this program is
# strictly prohibited. Any use of this program by an authorized
# licensee is strictly subject to the terms and conditions,
# including confidentiality obligations, set forth in the applicable
# License Agreement between RightScale.com, Inc. and
# the licensee

require File.join(File.dirname(__FILE__), 'spec_helper')

describe RightConf::OverridesLanguage do

  it 'should load overrides' do
    hash = RightConf::OverridesLanguage.parse("ruby.version='2.0'\nbundler.version = 3.0")
    if e = RightConf::OverridesLanguage.parse_error
      puts "Failed to parse overrides: #{e.message}"
    end
    hash.size.should == 2
    hash['ruby'].size.should == 1
    hash['ruby']['version'].should == '2.0'
    hash['bundler'].size.should == 1
    hash['bundler']['version'].should == '3.0'
    RightConf::OverridesLanguage.parse_error.should be_nil
  end

  it 'should catch errors' do
    hash = RightConf::OverridesLanguage.parse('foo')
    hash.should be_nil
    RightConf::OverridesLanguage.parse_error.should_not be_nil
  end

end


Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rconf-1.0.13 spec/overrides_language_spec.rb
rconf-1.0.12 spec/overrides_language_spec.rb
rconf-1.0.11 spec/overrides_language_spec.rb
rconf-1.0.10 spec/overrides_language_spec.rb
rconf-1.0.9 spec/overrides_language_spec.rb
rconf-1.0.8 spec/overrides_language_spec.rb
rconf-1.0.7 spec/overrides_language_spec.rb
rconf-1.0.6 spec/overrides_language_spec.rb
rconf-1.0.5 spec/overrides_language_spec.rb
rconf-1.0.4 spec/overrides_language_spec.rb
rconf-1.0.3 spec/overrides_language_spec.rb
rconf-1.0.1 spec/overrides_language_spec.rb
rconf-1.0.0 spec/overrides_language_spec.rb
rconf-0.10.1 spec/overrides_language_spec.rb
rconf-0.10.0 spec/overrides_language_spec.rb