-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsearcher_spec.rb
42 lines (34 loc) · 914 Bytes
/
searcher_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe Kindai::Searcher do
before do
Kindai::Util.logger.level = Logger::DEBUG
@searcher = Kindai::Searcher.search('我輩は')
end
it 'is Searcher' do
@searcher.should be_a_instance_of Kindai::Searcher
end
it 'has length' do
@searcher.length.should satisfy{|length| length > 10}
end
it 'has iterator' do
count = 0
@searcher.each{|book|
count += 1
book.should be_a_instance_of Kindai::Book
}
count.should == @searcher.length
end
end
describe Kindai::Searcher, 'with series' do
before do
Kindai::Util.logger.level = Logger::DEBUG
@searcher = Kindai::Searcher.search('講談日露戦争記')
end
it 'is Searcher' do
@searcher.should be_a_instance_of Kindai::Searcher
end
it 'has length' do
@searcher.length.should == 12
end
end