<commit_before>require 'spec_helper'

include WebMock::API

describe VCloud::Org do
  
  before(:all) do
    
  end
  
  it "retrieves an orginization" do    
    stub_request(:get, "https://some.vcloud.com/api/org/").
             with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.orgList+xml;version=1.5', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby', 'X-Vcloud-Authorization'=>'<KEY>'}).
             to_return(:status => 200, :body => VCloud::Test::Data::ORG_LIST_XML, :headers => {})
    stub_request(:get, "https://some.vcloud.com/api/org/aaa-bbb-ccc-ddd-eee-fff").
            with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.org+xml;version=1.5', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby', 'X-Vcloud-Authorization'=>'<KEY>'}).
            to_return(:status => 200, :body => VCloud::Test::Data::ORG_XML, :headers => {})
    
    org = VCloud::Org.from_reference(VCloud::Reference.new({:href => "https://some.vcloud.com/api/org/aaa-bbb-ccc-ddd-eee-fff"}))
  end
  
end<commit_msg>Added test for retrieving an org<commit_after>require 'spec_helper'

include WebMock::API

describe VCloud::Org do
  
  before(:all) do
    
  end
  
  it "retrieves an orginization" do    
    stub_request(:get, "https://some.vcloud.com/api/org/").
             with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.orgList+xml;version=1.5', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby', 'X-Vcloud-Authorization'=>'<KEY>'}).
             to_return(:status => 200, :body => VCloud::Test::Data::ORG_LIST_XML, :headers => {})
    stub_request(:get, "https://some.vcloud.com/api/org/aaa-bbb-ccc-ddd-eee-fff").
            with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.org+xml;version=1.5', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby', 'X-Vcloud-Authorization'=>'<KEY>'}).
            to_return(:status => 200, :body => VCloud::Test::Data::ORG_XML, :headers => {})
    
    org = VCloud::Org.from_reference(VCloud::Reference.new({:href => "https://some.vcloud.com/api/org/aaa-bbb-ccc-ddd-eee-fff"}))
    
    org.vdc_links.should have(1).items
    org.catalog_links.should have(1).items
    org.org_network_links.should have(1).items
  end
  
end
{'fraction_non_alphanumeric': 0.2070365358592693, 'fraction_numerical': 0.010374379792512404, 'mean_word_length': 3.9070796460176993, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 41, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6839744', 'n_tokens_mistral': 812, 'n_tokens_neox': 804, 'n_words': 102}