spec/unit/cobbler/system_spec.rb in cobbler-2.0.1 vs spec/unit/cobbler/system_spec.rb in cobbler-2.0.2

- old
+ new

@@ -21,7 +21,21 @@ Cobbler::System.expects(:make_call).with('save_system','id','muh') Cobbler::System.expects(:make_call).with('modify_system','id','modify_interface',{"ipaddress-eth0" => '192.168.1.1'},'muh') Cobbler::System.expects(:make_call).with('modify_system','id','modify_interface',{"ipaddress-eth1" => '192.168.2.1'},'muh') @test1.save end + it "should store all ks_meta" do + @test1 = Cobbler::System.new({'name' => 'foo'},false) + @test1.ks_meta = { 'meta1' => 'val1', 'meta2' => 'val2' } + Cobbler::System.expects(:login).returns('muh') + Cobbler::System.expects(:logout) + Cobbler::System.expects(:find_one).with('foo').returns('entry') + Cobbler::System.expects(:connect).returns(Object.new) + Cobbler::System.expects(:make_call).with('get_system_handle','foo','muh').returns('id') + Cobbler::System.expects(:make_call).with('save_system','id','muh') + str = '' + @test1.ks_meta.each {|k,v| str << "#{k}=#{v} " } + Cobbler::System.expects(:make_call).with('modify_system','id','ks_meta',str.strip,'muh') + @test1.save + end end -end \ No newline at end of file +end