Sha256: 76c880e08556e2eb51eab2ff4bbb35761dfe0927e5f24b8e829e72659cafc9ae

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# require "#{File.expand_path(File.dirname(__FILE__))}/helper"
# require 'crystal/support'
# require 'crystal/environment/dependency_resolver'
# 
# describe "Dependency resolver" do    
#   before :each do
#     @dr = Crystal::DependencyResolver.new
#     @result = []
#   end
#   
#   attr_reader :result
#   
#   def add s
#     @result << s
#   end
#   
#   def run *args, &block
#     @dr.run *args, &block
#   end
#   
#   def load token
#     @dr.call(token)
#   end
#   
#   it "should be ordered" do
#     run(:init){add :init}
#     run(:a, :after => :init){add :a}  
#     run(:b, :after => :a){add :b}
#     run(:c, :after => :b){add :c}
#   
#     load :init
#     
#     result.should == [:init, :a, :b, :c]
#   end  
#   
#   it "should be ordered 2 (from error)" do
#     run(:init){add :init}
#     run(:_b, :before => :init){add :_b}
#     run(:b_, :after => :init){add :b_}
#     
#     run(:_c, :before => :_b){add :_c}
#     run(:c_, :after => :b_){add :c_}
#         
#     run(:_a, :before => :init){add :_a}
#     run(:a_, :after => :init){add :a_}
#       
#     load :init    
#     result.should == [:_c, :_b, :_a, :init, :b_, :a_, :c_]
#   end
# end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
crystal-0.0.13 spec/environment/_dependency_resolver_spec.rb
crystal-0.0.12 spec/environment/_dependency_resolver_spec.rb
crystal_ext-0.0.11 spec/environment/_dependency_resolver_spec.rb