Sha256: 84592f4da912f3dc0f33823c3e98b2c8afd6307cc7b1e2a544043b766c0f1583

Contents?: true

Size: 648 Bytes

Versions: 15

Compression:

Stored size: 648 Bytes

Contents

#--
# Copyright (c) 2010-2012 Engine Yard, Inc.
# Copyright (c) 2007-2009 Sun Microsystems, Inc.
# This source code is available under the MIT license.
# See the file LICENSE.txt for details.
#++

require File.expand_path('../../spec_helper', __FILE__)

describe Warbler::Traits do
  it "are ordered by fewer dependencies first" do
    traits = Warbler::TraitsDependencyArray.new( Warbler::Traits.constants.map {|t| Warbler::Traits.const_get(t)})
    result = traits.shuffle!.tsort

    result.each do |trait|
      trait.requirements.each do |requirement|
        result.index(requirement).should < result.index(trait)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
warbler-1.4.10 spec/warbler/traits_spec.rb
warbler-2.0.2 spec/warbler/traits_spec.rb
warbler-2.0.1 spec/warbler/traits_spec.rb
warbler-2.0.0 spec/warbler/traits_spec.rb
warbler-2.0.0.rc3 spec/warbler/traits_spec.rb
warbler-2.0.0.rc2 spec/warbler/traits_spec.rb
warbler-2.0.0.rc1 spec/warbler/traits_spec.rb
warbler-2.0.0.pre3 spec/warbler/traits_spec.rb
warbler-2.0.0.pre2 spec/warbler/traits_spec.rb
warbler-1.4.9 spec/warbler/traits_spec.rb
warbler-1.4.8 spec/warbler/traits_spec.rb
warbler-2.0.0.pre1 spec/warbler/traits_spec.rb
warbler-1.4.7 spec/warbler/traits_spec.rb
warbler-1.4.6 spec/warbler/traits_spec.rb
warbler-1.4.5 spec/warbler/traits_spec.rb