0
0
Fork 0

Add tests for Storage:each

This commit is contained in:
Stormwind 2015-05-01 08:23:14 +02:00
parent 7d7f01b6d2
commit 06e61a7aa0
3 changed files with 18 additions and 2 deletions

View File

@ -77,7 +77,7 @@ module Rubella
Storage.new (storage.data+@data), @length
end
# Passes each dataset trought the given block.
# Passes each dataset through the given block.
#
# @param pointer to block
#

View File

@ -0,0 +1,16 @@
require 'spec_helper'
describe Rubella::Storage, '.each' do
it "passes the data through the given block" do
storage = Rubella::Storage.new [3, 4, 5]
sum = 0
storage.each do |value|
sum = sum + value
end
expect(sum).to eq(12)
end
end

View File

@ -8,4 +8,4 @@ describe Rubella::Storage, '.length' do
expect(storage.length).to eq 3
end
end
end