kindle_highlights_api 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +7 -2
- data/lib/kindle_highlights_api/fetcher.rb +0 -2
- data/lib/kindle_highlights_api/version.rb +1 -1
- data/test/integration/fetcher_integration_test.rb +26 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4e7cb938f50e49b1b999361593a8b27dbb2b007
|
4
|
+
data.tar.gz: 7a14c53df9e9ae28e075f53452ca55ed3dcd5e24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c193931caa20708e278902e03e1ea2f2ed77df70a46d3197f7c29820c6b01871e30abddd41664176b89fc8da276827353ceda349f18379a6287bd793e8ccd6c7
|
7
|
+
data.tar.gz: d967ad43959d75dcb9bee2c634996abd68df00133bc1074447a1750514050c6919a46f0f34f72c5b9ac5ddfc8875984d49d6cad5187687cfe5e363f06ef3f594
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -4,8 +4,13 @@ require "rake/testtask"
|
|
4
4
|
desc 'run all tests'
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
6
6
|
t.libs << "test"
|
7
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
8
|
-
|
7
|
+
t.test_files = FileList["test/**/*_test.rb"].exclude(/integration/)
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'run all integration tests'
|
11
|
+
Rake::TestTask.new(:integration) do |t|
|
12
|
+
t.libs << "test"
|
13
|
+
t.test_files = FileList["test/integration/*_test.rb"]
|
9
14
|
end
|
10
15
|
|
11
16
|
desc 'run kindle_highlights_api console'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'kindle_highlights_api'
|
5
|
+
require 'pry'
|
6
|
+
|
7
|
+
class FetcherIntegrationTest < MiniTest::Unit::TestCase
|
8
|
+
EMAIL = Base64.decode64("a2luZGxlLmhpZ2hsaWdodHMuYXBpQGdtYWlsLmNvbQ==\n")
|
9
|
+
PASS = Base64.decode64("aGlnaGxpZ2h0c2FwaTEyMw==\n")
|
10
|
+
|
11
|
+
def test_fetch_all
|
12
|
+
fetcher = KindleHighlightsAPI::Fetcher.new(EMAIL, PASS)
|
13
|
+
expected_titles = ["Les Misérables (English language)", "A Tale of Two Cities", "The Rámáyan of Válmíki"]
|
14
|
+
|
15
|
+
expected_highlights = ["The coffee-room had no other occupant, that forenoon, than the gentleman in brown.",
|
16
|
+
"A large cask of wine had been dropped and broken, in the street.",
|
17
|
+
"For, the time was to come, when the gaunt scarecrows of that region should have watched the lamplighter,",
|
18
|
+
"Then, as the darkness closed in, the daughter laid her head down on the hard ground close at the father's side, and watched him.",
|
19
|
+
"A woman of orderly and industrious appearance rose from her knees in a corner, with sufficient haste and trepidation to show that she was the person referred to."]
|
20
|
+
|
21
|
+
books = fetcher.fetch_all
|
22
|
+
|
23
|
+
assert_equal expected_titles, books.map(&:title)
|
24
|
+
assert_equal expected_highlights, books[1].highlights
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kindle_highlights_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaurav Chande
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- test/fixtures/html/kindle_home_page.html
|
88
88
|
- test/fixtures/html/login_page.html
|
89
89
|
- test/fixtures/html/signin_post_response.txt
|
90
|
+
- test/integration/fetcher_integration_test.rb
|
90
91
|
- test/test_helper.rb
|
91
92
|
homepage: https://github.com/gauravmc/kindle_highlights_api
|
92
93
|
licenses:
|
@@ -125,5 +126,6 @@ test_files:
|
|
125
126
|
- test/fixtures/html/kindle_home_page.html
|
126
127
|
- test/fixtures/html/login_page.html
|
127
128
|
- test/fixtures/html/signin_post_response.txt
|
129
|
+
- test/integration/fetcher_integration_test.rb
|
128
130
|
- test/test_helper.rb
|
129
131
|
has_rdoc:
|