Revision c6c217d4 src/oca/ruby/test/VirtualMachine_spec.rb

View differences:

src/oca/ruby/test/VirtualMachine_spec.rb
123 123
            @vm['HISTORY/HOSTNAME'].should eql('dummyhost')
124 124
            @vm['HISTORY/PSTIME'].should eql('1277375186')
125 125
        end
126

  
127
        it "should get a hash representation of the VM" do
128
            vm_hash = @vm.to_hash
129
            vm_hash['VM']['ID'].should eql('6')
130
            vm_hash['VM']['NAME'].should eql('vm-example')
131
            vm_hash['VM']['LCM_STATE'].should eql('3')
132
            vm_hash['VM']['DEPLOY_ID'].should eql('dummy')
133
            vm_hash['VM']['TEMPLATE']['MEMORY'].should eql('512')
134
            vm_hash['VM']['TEMPLATE']['CONTEXT']['DNS'].should eql('192.169.1.4')
135
            vm_hash['VM']['TEMPLATE']['DISK'][0]['TARGET'].should eql('sda')
136
            vm_hash['VM']['HISTORY']['HOSTNAME'].should eql('dummyhost')
137
            vm_hash['VM']['HISTORY']['PSTIME'].should eql('1277375186')
138
        end
139 126
    end
140 127

  
141 128
    describe "VirtualMachine using REXML" do
......
256 243
            @vm['HISTORY/HOSTNAME'].should eql('dummyhost')
257 244
            @vm['HISTORY/PSTIME'].should eql('1277375186')
258 245
        end
259

  
260
        it "should get a hash representation of the VM" do
261
            vm_hash = @vm.to_hash
262
            vm_hash['VM']['ID'].should eql('6')
263
            vm_hash['VM']['NAME'].should eql('vm-example')
264
            vm_hash['VM']['LCM_STATE'].should eql('3')
265
            vm_hash['VM']['DEPLOY_ID'].should eql('dummy')
266
            vm_hash['VM']['TEMPLATE']['MEMORY'].should eql('512')
267
            vm_hash['VM']['TEMPLATE']['CONTEXT']['DNS'].should eql('192.169.1.4')
268
            vm_hash['VM']['TEMPLATE']['DISK'][0]['TARGET'].should eql('sda')
269
            vm_hash['VM']['HISTORY']['HOSTNAME'].should eql('dummyhost')
270
            vm_hash['VM']['HISTORY']['PSTIME'].should eql('1277375186')
271
        end
272 246
    end
273 247

  
274 248

  

Also available in: Unified diff