Sha256: bfdd21565e28db72fe1162b6e699e287048bc124224227ad61ac1e34b8c3452c

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'
# related libs
require 'gorillib/model'
require 'gorillib/model/field'
require 'gorillib/model/defaults'
# libs under test
require 'gorillib/builder'
require 'gorillib/builder/field'
require 'gorillib/string/simple_inflector'
# testing helpers

load GORILLIB_ROOT_DIR('examples/builder/ironfan.rb')

module Gorillib::Test       ; end
module Meta::Gorillib::Test ; end

describe Gorillib::Builder, :model_spec => true do
  after(:each){   Gorillib::Test.nuke_constants ; Meta::Gorillib::Test.nuke_constants }
  def example_cluster
    Gorillib::Test.cluster
  end

  let(:ec_webnode  ){ fac = example_cluster.facet(:webnode); fac.cluster(example_cluster) ; fac }
  let(:ec_webnode_a){ svr = ec_webnode.server(:a);           svr.facet(ec_webnode)        ; svr }

  # it 'is awesome'

  context "collections get a {foo}_name accessor:" do
    it("facet.cluster_name"){ ec_webnode.cluster_name.should == :yellowhat }
    it("server.facet_name" ){ ec_webnode_a.facet_name.should == :webnode   }
  end

  context "collections get a `has_{foo}` tester:" do
    it("server.facet?"    ){ ec_webnode_a.facet?.should be_true }
    it("facet.has_server?"){ ec_webnode.should have_server(:a) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gorillib-0.4.0pre spec/examples/builder/ironfan_spec.rb
gorillib-0.4.1pre spec/examples/builder/ironfan_spec.rb