Changeset 19118 for lang/ruby

Show
Ignore:
Timestamp:
09/10/08 14:55:56 (2 months ago)
Author:
authorNari
Message:

add test. bug fix.

Location:
lang/ruby/ymldot
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ymldot/lib/ymldot.rb

    r19115 r19118  
    9292 
    9393  def eval_entity(table) 
    94     columns = table["columns"] 
     94    columns = table["columns"]; columns ||= [] 
    9595    @entities[table["name"]] ||= Entity.new(table["name"], table["dependent"], columns) 
    9696  end 
  • lang/ruby/ymldot/spec/ymldot_spec.rb

    r19115 r19118  
    163163  end 
    164164end 
     165 
     166describe Ymldot, "で読み込んだ.ymlにてカラムが無くforeingkeyのみのEntityがあった場合" do 
     167  before do 
     168    @ymldot = Ymldot.new("test_columns_none.yml") 
     169  end 
     170 
     171  it "#entities['foo'].columnsは空の配列であること" do 
     172    puts @ymldot.node.inspect 
     173    @ymldot.entities["foo"].columns.should == [] 
     174    @ymldot.entities["hoge"].columns.should be_empty 
     175  end 
     176end