bible_reference_parser 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bible_reference_parser}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan McWilliams"]
12
- s.date = %q{2010-09-29}
12
+ s.date = %q{2010-10-06}
13
13
  s.description = %q{BibleReferenceParser can parse scriptures passages, such as 'Gen. 1:15-18, 21' to the individual books, chapters and verses in the passage. It also provides validation for invalid book names, chapters, and verses.}
14
14
  s.email = %q{nathan.mcwilliams@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -134,7 +134,8 @@ module BibleReferenceParser
134
134
 
135
135
  books << BookReference.new(book_name, contents)
136
136
  end
137
-
137
+
138
+ books.add_error "'#{passage}' does not contain any books" if books.empty?
138
139
  books
139
140
  end
140
141
 
@@ -93,6 +93,7 @@ describe BookReference do
93
93
  it "should correctly identify when there is only 1 book" do
94
94
  books = BookReference.parse_books("Genesis 1:1")
95
95
  books.length.should eql 1
96
+ books.errors.length.should eql 0
96
97
  end
97
98
 
98
99
  it "should correctly identify when there are 2 books" do
@@ -107,6 +108,11 @@ describe BookReference do
107
108
  books = BookReference.parse_books(passage)
108
109
  books.length.should eql 10
109
110
  end
111
+
112
+ it "should contain an error if no books are specified" do
113
+ books = BookReference.parse_books("777")
114
+ books.errors.first.should eql "'777' does not contain any books"
115
+ end
110
116
 
111
117
  it "should parse names beginning with a number" do
112
118
  books = BookReference.parse_books("1 samuel 1:1, 2 samuel, 1cor 3, 2cor")
@@ -165,6 +165,7 @@ describe ReferenceCollection do
165
165
  it "should not return contain duplicate errors" do
166
166
  books = BookReference.parse_books "Genesis 51"
167
167
  books.clean
168
+ puts books.errors.inspect
168
169
  books.errors.length.should eql 1
169
170
  end
170
171
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nathan McWilliams
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-29 00:00:00 -07:00
17
+ date: 2010-10-06 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -100,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- hash: 4012488893589496210
103
+ hash: -1796288211736281972
104
104
  segments:
105
105
  - 0
106
106
  version: "0"