cfoundry 1.1.0.rc3 → 1.1.0.rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -203,6 +203,7 @@ module CFoundry::V2
203
203
 
204
204
  define_method(name) do
205
205
  return @cache[name] if @cache.key?(name)
206
+ return @client.send(name) unless persisted?
206
207
 
207
208
  @cache[name] =
208
209
  if @manifest && @manifest[:entity].key?(name)
@@ -6,6 +6,7 @@ module CFoundry::V2
6
6
  validates_format_of :host, :with => /\A[a-z]+([a-z0-9\-]*[a-z0-9]+)?\Z/i
7
7
  validates_length_of :host, :maximum => 63
8
8
  validates_presence_of :domain
9
+ validates_presence_of :space
9
10
  to_one :domain
10
11
  to_one :space
11
12
 
@@ -1,4 +1,4 @@
1
1
  module CFoundry # :nodoc:
2
2
  # CFoundry library version number.
3
- VERSION = "1.1.0.rc3".freeze
3
+ VERSION = "1.1.0.rc4".freeze
4
4
  end
@@ -260,10 +260,11 @@ describe CFoundry::V2::Model do
260
260
  end
261
261
 
262
262
  describe "creating a new object" do
263
+ let(:new_object) {
264
+ client.fake_model_with_attribute
265
+ }
266
+
263
267
  describe "getting attributes" do
264
- let(:new_object) {
265
- client.fake_model_with_attribute
266
- }
267
268
 
268
269
  it "does not go to cloud controller" do
269
270
  expect {
@@ -276,9 +277,18 @@ describe CFoundry::V2::Model do
276
277
  new_object.time.should == "now"
277
278
  end
278
279
  end
280
+
281
+ describe "getting associations" do
282
+ describe "to_one associations" do
283
+ it "returns the an empty object of the association's type" do
284
+ new_object.domain.guid.should be_nil
285
+ end
286
+ end
287
+ end
279
288
  end
280
289
  end
281
290
 
282
291
  class FakeModelWithAttribute < CFoundry::V2::FakeModel
283
292
  attribute :time, :string
293
+ to_one :domain
284
294
  end
@@ -3,10 +3,11 @@ require 'spec_helper'
3
3
 
4
4
  module CFoundry::V2
5
5
  describe Route do
6
- subject { Route.new(nil, nil) }
6
+ subject { Route.new(nil, fake_client) }
7
7
 
8
8
  describe "validations" do
9
9
  it { should validate_presence_of(:domain) }
10
+ it { should validate_presence_of(:space) }
10
11
 
11
12
  # http://tools.ietf.org/html/rfc1035
12
13
  it "only allows host names according to RFC1035" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfoundry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.rc3
4
+ version: 1.1.0.rc4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -390,7 +390,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
390
390
  version: '0'
391
391
  segments:
392
392
  - 0
393
- hash: 1933864323427850258
393
+ hash: -2709231256773334971
394
394
  required_rubygems_version: !ruby/object:Gem::Requirement
395
395
  none: false
396
396
  requirements: