incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1004996 - in /incubator/deltacloud/trunk/server: ./ tests/ views/images/
Date Wed, 06 Oct 2010 12:02:01 GMT
Author: mfojtik
Date: Wed Oct  6 12:02:00 2010
New Revision: 1004996

URL: http://svn.apache.org/viewvc?rev=1004996&view=rev
Log:
Minor fixes which make API work under Ruby 1.9.2

Modified:
    incubator/deltacloud/trunk/server/config.ru
    incubator/deltacloud/trunk/server/server.rb
    incubator/deltacloud/trunk/server/tests/api_test.rb
    incubator/deltacloud/trunk/server/tests/common.rb
    incubator/deltacloud/trunk/server/tests/hardware_profiles_test.rb
    incubator/deltacloud/trunk/server/tests/images_test.rb
    incubator/deltacloud/trunk/server/tests/instance_states_test.rb
    incubator/deltacloud/trunk/server/tests/instances_test.rb
    incubator/deltacloud/trunk/server/tests/realms_test.rb
    incubator/deltacloud/trunk/server/views/images/show.html.haml

Modified: incubator/deltacloud/trunk/server/config.ru
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/config.ru?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/config.ru (original)
+++ incubator/deltacloud/trunk/server/config.ru Wed Oct  6 12:02:00 2010
@@ -1,5 +1,7 @@
 require 'rubygems'
 require 'sinatra'
 
+$:.unshift File.join(File.dirname(__FILE__), '.')
+
 require 'server.rb'
 run Sinatra::Application

Modified: incubator/deltacloud/trunk/server/server.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/server.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/server.rb (original)
+++ incubator/deltacloud/trunk/server/server.rb Wed Oct  6 12:02:00 2010
@@ -14,6 +14,8 @@ require 'lib/deltacloud/helpers/blob_str
 configure do
   set :raise_errors => false
   set :show_exceptions, false
+  set :views, File.dirname(__FILE__) + '/views'
+  set :public, File.dirname(__FILE__) + '/public'
 end
 
 configure :development do

Modified: incubator/deltacloud/trunk/server/tests/api_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/api_test.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/api_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/api_test.rb Wed Oct  6 12:02:00 2010
@@ -1,3 +1,4 @@
+$:.unshift File.join(File.dirname(__FILE__), '..')
 require 'tests/common'
 
 module DeltacloudUnitTest
@@ -10,7 +11,7 @@ module DeltacloudUnitTest
 
     def test_it_returns_entry_points
       do_xml_request '/api'
-      (last_xml_response/'/api/link').map.size.should > 0
+      (last_xml_response/'/api/link').to_a.size.should > 0
     end
 
     def test_it_has_correct_attributes_set

Modified: incubator/deltacloud/trunk/server/tests/common.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/common.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/common.rb (original)
+++ incubator/deltacloud/trunk/server/tests/common.rb Wed Oct  6 12:02:00 2010
@@ -1,3 +1,5 @@
+$:.unshift File.join(File.dirname(__FILE__), '..')
+
 require 'rubygems'
 require 'base64'
 require 'test/unit'

Modified: incubator/deltacloud/trunk/server/tests/hardware_profiles_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/hardware_profiles_test.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/hardware_profiles_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/hardware_profiles_test.rb Wed Oct  6 12:02:00
2010
@@ -10,7 +10,7 @@ module DeltacloudUnitTest
 
     def test_it_returns_hardware_profiles
       do_xml_request '/api/hardware_profiles'
-      (last_xml_response/'hardware_profiles/hardware_profile').map.size.should > 0
+      (last_xml_response/'hardware_profiles/hardware_profile').to_a.size.should > 0
     end
 
     def test_it_has_correct_attributes_set
@@ -109,7 +109,7 @@ module DeltacloudUnitTest
       (profile/'property[@name="storage"]').first['kind'].should == 'enum'
       (profile/'property[@name="storage"]').first['unit'].should == 'GB'
       (profile/'property[@name="storage"]/enum').size.should == 1
-      (profile/'property[@name="storage"]/enum/entry').map.size.should == 3
+      (profile/'property[@name="storage"]/enum/entry').to_a.size.should == 3
       (profile/'property[@name="storage"]/enum/entry').each do |entry|
         entry.attributes.keys.should == [ 'value' ]
         entry['value'].should_not == nil

Modified: incubator/deltacloud/trunk/server/tests/images_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/images_test.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/images_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/images_test.rb Wed Oct  6 12:02:00 2010
@@ -14,7 +14,7 @@ module DeltacloudUnitTest
 
     def test_it_returns_images
       do_xml_request '/api/images', {}, true
-      (last_xml_response/'images/image').map.size.should > 0
+      (last_xml_response/'images/image').to_a.size.should > 0
     end
 
     def test_it_has_correct_attributes_set

Modified: incubator/deltacloud/trunk/server/tests/instance_states_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/instance_states_test.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/instance_states_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/instance_states_test.rb Wed Oct  6 12:02:00 2010
@@ -14,14 +14,14 @@ module DeltacloudUnitTest
 
     def test_it_returns_instance_states
       do_xml_request '/api/instance_states', {}, true
-      (last_xml_response/'states/state').map.size.should > 0
+      (last_xml_response/'states/state').to_a.size.should > 0
     end
 
     def test_each_state_has_transition
       do_xml_request '/api/instance_states', {}, true
       (last_xml_response/'states/state').each do |state|
         next if state['name'].eql?('finish') # Finnish state doesn't have transitions
-        (state/'transition').map.size.should > 0
+        (state/'transition').to_a.size.should > 0
         (state/'transition').each do |transition|
           transition['to'].should_not == nil
         end

Modified: incubator/deltacloud/trunk/server/tests/instances_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/instances_test.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/instances_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/instances_test.rb Wed Oct  6 12:02:00 2010
@@ -14,7 +14,7 @@ module DeltacloudUnitTest
 
     def test_it_returns_instances
       do_xml_request '/api/instances', {}, true
-      (last_xml_response/'instances/instance').map.size.should > 0
+      (last_xml_response/'instances/instance').to_a.size.should > 0
     end
 
     def test_it_has_correct_attributes_set
@@ -181,14 +181,14 @@ module DeltacloudUnitTest
       ['RUNNING', 'STOPPED'].include?((instance/'state').text).should == true
 
       (instance/'public_addreses').should_not == nil
-      (instance/'public_addresses/address').map.size.should > 0
+      (instance/'public_addresses/address').to_a.size.should > 0
       (instance/'public_addresses/address').first.text.should_not == ""
 
       (instance/'private_addresses').should_not == nil
-      (instance/'private_addresses/address').map.size.should > 0
+      (instance/'private_addresses/address').to_a.size.should > 0
       (instance/'private_addresses/address').first.text.should_not == ""
 
-      (instance/'actions/link').map.size.should > 0
+      (instance/'actions/link').to_a.size.should > 0
       (instance/'actions/link').each do |link|
         link['href'].should_not == ""
         link['rel'].should_not == ""

Modified: incubator/deltacloud/trunk/server/tests/realms_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/realms_test.rb?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/realms_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/realms_test.rb Wed Oct  6 12:02:00 2010
@@ -14,7 +14,7 @@ module DeltacloudUnitTest
 
     def test_it_returns_realms
       do_xml_request '/api/realms', {}, true
-      (last_xml_response/'realms/realm').map.size.should > 0
+      (last_xml_response/'realms/realm').to_a.size.should > 0
     end
 
     def test_it_has_correct_attributes_set

Modified: incubator/deltacloud/trunk/server/views/images/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/images/show.html.haml?rev=1004996&r1=1004995&r2=1004996&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/images/show.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/images/show.html.haml Wed Oct  6 12:02:00 2010
@@ -9,7 +9,7 @@
       = @image.name
     %dt Owner
     %dd
-      = link_to @image.owner_id, images_url( :owner_id => @image.owner_id )
+      = link_to @image.owner_id, image_url( :owner_id => @image.owner_id )
     %dt Architecture
     %dd
       = @image.architecture



Mime
View raw message