bible_gateway 0.0.8 → 0.0.9
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/bible_gateway/version.rb +1 -1
- data/spec/bible_gateway_spec.rb +19 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60712c324a1d65e200ca3cabec323b09f58b1709
|
4
|
+
data.tar.gz: 0a492351364e7bf4edb61d4c0dc4e2a6fc620b45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a7e1bb3738b94cda7910a19742b6acd24b09d0218890b9051ea49cffab118e2136e62e8e19795fefb397023b0b61a6c22862ea6c81512072a6dbb233b8648e5
|
7
|
+
data.tar.gz: e9ad62c20383174c6ad29b919a78bda9ac7e6a1c5ce21592b6a382e1317dfde84e09e5e78f024c3a85a4ce205a1d178b78e982ee3a977ef077cc4661bfcf02a5
|
data/.travis.yml
CHANGED
data/spec/bible_gateway_spec.rb
CHANGED
@@ -3,33 +3,33 @@ require "spec_helper"
|
|
3
3
|
|
4
4
|
describe BibleGateway do
|
5
5
|
it "should have a list of versions" do
|
6
|
-
BibleGateway.versions.
|
6
|
+
expect(BibleGateway.versions).not_to be_empty
|
7
7
|
end
|
8
8
|
|
9
9
|
describe "setting the version" do
|
10
10
|
it "should have a default version" do
|
11
11
|
gateway = BibleGateway.new
|
12
|
-
gateway.version.
|
12
|
+
expect(gateway.version).to eq(:king_james_version)
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should be able to set the version to use" do
|
16
16
|
gateway = BibleGateway.new :english_standard_version
|
17
|
-
gateway.version.
|
17
|
+
expect(gateway.version).to eq(:english_standard_version)
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should raise an exception for unknown version" do
|
21
|
-
|
21
|
+
expect { BibleGateway.new :unknown_version }.to raise_error(BibleGatewayError)
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should be able to change the version to use" do
|
25
25
|
gateway = BibleGateway.new
|
26
26
|
gateway.version = :english_standard_version
|
27
|
-
gateway.version.
|
27
|
+
expect(gateway.version).to eq(:english_standard_version)
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should raise an exception when changing to unknown version" do
|
31
31
|
gateway = BibleGateway.new
|
32
|
-
|
32
|
+
expect { gateway.version = :unknown_version }.to raise_error(BibleGatewayError)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -37,43 +37,43 @@ describe BibleGateway do
|
|
37
37
|
context "verse" do
|
38
38
|
it "should find the passage title" do
|
39
39
|
title = BibleGateway.new(:english_standard_version).lookup("John 1:1")[:title]
|
40
|
-
title.
|
40
|
+
expect(title).to eq("John 1:1")
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should find and clean the passage content" do
|
44
44
|
content = BibleGateway.new(:english_standard_version).lookup("John 1:1")[:content]
|
45
|
-
content.
|
46
|
-
content.
|
45
|
+
expect(content).to include("<h3>The Word Became Flesh</h3>")
|
46
|
+
expect(content).to include("In the beginning was the Word, and the Word was with God, and the Word was God.")
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
context "chapter" do
|
51
51
|
it "should find the passage title" do
|
52
52
|
title = BibleGateway.new(:english_standard_version).lookup("John 3")[:title]
|
53
|
-
title.
|
53
|
+
expect(title).to eq("John 3")
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should find and clean the passage content" do
|
57
57
|
content = BibleGateway.new(:english_standard_version).lookup("John 3")[:content]
|
58
|
-
content.
|
59
|
-
content.
|
60
|
-
content.
|
58
|
+
expect(content).to include("<h3>You Must Be Born Again</h3>")
|
59
|
+
expect(content).to include("<h3>For God So Loved the World</h3>")
|
60
|
+
expect(content).to include("For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life.")
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
context "multiple chapters" do
|
65
65
|
it "should find the passage title" do
|
66
66
|
title = BibleGateway.new(:english_standard_version).lookup("Psalm 1-5")[:title]
|
67
|
-
title.
|
67
|
+
expect(title).to eq("Psalm 1-5")
|
68
68
|
end
|
69
69
|
|
70
70
|
it "should find and clean the passage content" do
|
71
71
|
content = BibleGateway.new(:english_standard_version).lookup("Psalm 1-5")[:content]
|
72
|
-
content.
|
73
|
-
content.
|
74
|
-
content.
|
75
|
-
content.
|
76
|
-
content.
|
72
|
+
expect(content).to include("<h3>The Way of the Righteous and the Wicked</h3>")
|
73
|
+
expect(content).to include("<span class=\"chapternum\">1 </span>")
|
74
|
+
expect(content).to include("<h3>Save Me, O My God</h3>")
|
75
|
+
expect(content).to include("<span class=\"chapternum\">1 </span>")
|
76
|
+
expect(content).to include("For you are not a God who delights in wickedness;")
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|