spec/platform_spec.rb in rconf-0.8.21 vs spec/platform_spec.rb in rconf-0.8.29

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide. +# 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 @@ -11,27 +11,33 @@ require File.join(File.dirname(__FILE__), 'spec_helper') describe RightConf::Platform do - it 'should try to dispatch using platform family' do + it 'should try to dispatch using platform family' do def test_amiga(val); val; end flexmock(RightConf::Platform.instance).should_receive(:family).and_return('amiga') RightConf::Platform.dispatch(44) { :test }.should == 44 end - it 'should try to dispatch using platform family and flavor' do + it 'should try to dispatch using platform family and flavor' do def test_atari_st(val); val; end flexmock(RightConf::Platform.instance).should_receive(:flavor).and_return('st') flexmock(RightConf::Platform.instance).should_receive(:family).and_return('atari') RightConf::Platform.dispatch(43) { :test }.should == 43 end -it 'should try to dispatch using platform family, flavor and release' do + it 'should try to dispatch using platform family, flavor and release' do def test_commodore_c_64(val); val; end flexmock(RightConf::Platform.instance).should_receive(:release).and_return('64') flexmock(RightConf::Platform.instance).should_receive(:flavor).and_return('c') flexmock(RightConf::Platform.instance).should_receive(:family).and_return('commodore') RightConf::Platform.dispatch(42) { :test }.should == 42 + end + + it 'should default to no suffix' do + def test(val); val; end + flexmock(RightConf::Platform.instance).should_receive(:family).and_return('non-existent') + RightConf::Platform.dispatch(41) { :test }.should == 41 end end