Sha256: 03da507741f7c105d0c2fd8dcae3836aab00bbd79592f0a16d477dbdb0df1834

Contents?: true

Size: 542 Bytes

Versions: 5

Compression:

Stored size: 542 Bytes

Contents

require 'spec_helper'

describe Structural::Model::Association do
  module Foo
    module Bar
      module Baz
        class Quux
        end
      end
    end
  end

  let(:model) { double(:name => "Foo::Bar::Baz::Quux") }
  let(:has_one) { Structural::Model::Association.new(model, "yak", {}) }

  describe "hierarchy" do
    it "builds the class and module hierarchy for the model" do
      has_one.hierarchy.constants.should eq [
        Foo::Bar::Baz::Quux,
        Foo::Bar::Baz,
        Foo::Bar,
        Foo
      ]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
structural-0.2.0 spec/lib/structural/model/association_spec.rb
structural-0.1.0 spec/lib/structural/model/association_spec.rb
structural-0.0.3 spec/lib/structural/model/association_spec.rb
structural-0.0.2 spec/lib/structural/model/association_spec.rb
structural-0.0.1 spec/lib/structural/model/association_spec.rb