Created
December 25, 2014 10:06
-
-
Save mkaschenko/8901774ba4a16b5eb5cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'temp_crawler/storage' | |
| describe Storage do | |
| subject(:storage) { described_class.new(name: 'name') } | |
| before { storage.clear } | |
| describe '#add(value)' do | |
| it 'adds a uniq value' do | |
| expect { storage.add('*') }.to change { storage.size }.by(1) | |
| expect { storage.add('*') }.to change { storage.size }.by(0) | |
| end | |
| end | |
| describe '#all' do | |
| it 'returns added values' do | |
| 3.times { |i| storage.add(i) } | |
| expect(storage.all).to eq(['0', '1', '2']) | |
| end | |
| end | |
| describe '#size' do | |
| it 'returns a number of added values' do | |
| 5.times { |i| storage.add(i) } | |
| expect(storage.size).to eq(5) | |
| end | |
| end | |
| describe '#clear' do | |
| it 'removes added values' do | |
| storage.add('^_^') | |
| storage.clear | |
| expect(storage.all).to be_empty | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment