復習

だめだ,ちゃんと英語勉強したほうがいいなぁ。

describe Array, "is empty"   do
  before do
    @array = 
  end

  it "should have 0 items" do
    @array.should have(0).items
  end

  it "should not find and result is nil when condtion is [e == 'node1']" do
    @array.find { |e| e == 'node1' }.should eql nil
  end
  
  it "should not find and result is nil when condition is [e == 'not_found']" do
    @array.find { |e| e == 'not_found' }.should eql nil
  end  
end

describe Array, "is added 3 items include [node1]" do
  before do
    @array = 
    @array << "node0"
    @array << "node1"
    @array << "node2"
  end
 
  it "should have 3 items" do
    @array.should have(3).items
  end
 
  it "should find [node1] when condition is [e == 'node1']" do
    @array.find { |e| e == 'node1' }.should eql "node1"
  end
  
  it "should not find and result is nil when condition is [e == 'not_found']" do
    @array.find { |e| e == 'not_found' }.should eql nil
  end
end