nicorepo 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/nicorepo/version.rb +1 -1
- data/lib/nicorepo.rb +1 -1
- data/spec/cli/cli_config_spec.rb +6 -6
- data/spec/nicorepo_spec.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77bc420c0f28c252e64072f5327ee79df42c52f2
|
4
|
+
data.tar.gz: eeb940e3c0f7bce3837c5ad4140f4c051e88618f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aa9cec6aec5ebaaa589a2911c71aa37488117657fdeca31e5ee773b6093536d888946959a2198846eab3125317c0e14dbc4c406128a300a2c8b623955678982
|
7
|
+
data.tar.gz: 2a10ba1150d48817bc994a00b38f3a2cd2255b4e17f8c3a748991b25d95a8a7f040c5ffca853dde77d4d8e289a48071601315cdfea822ab73f897a00ea573fb0
|
data/CHANGELOG.md
CHANGED
data/lib/nicorepo/version.rb
CHANGED
data/lib/nicorepo.rb
CHANGED
@@ -12,7 +12,7 @@ class Nicorepo
|
|
12
12
|
|
13
13
|
def initialize
|
14
14
|
@agent = Mechanize.new
|
15
|
-
@agent.ssl_version = '
|
15
|
+
@agent.ssl_version = 'TLSv1'
|
16
16
|
@agent.request_headers = { 'accept-language' => 'ja-JP', 'content-language' => 'ja-JP' }
|
17
17
|
@parser = Parser.new(@agent)
|
18
18
|
@logined = false
|
data/spec/cli/cli_config_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe Nicorepo::Cli::Configuration do
|
|
4
4
|
let(:conf) { Nicorepo::Cli::Configuration.new }
|
5
5
|
|
6
6
|
before do
|
7
|
-
Nicorepo::Cli::Configuration.
|
7
|
+
allow_any_instance_of(Nicorepo::Cli::Configuration).to receive(:load_config).and_return(config_values)
|
8
8
|
end
|
9
9
|
|
10
10
|
describe "#request_num" do
|
@@ -15,7 +15,7 @@ describe Nicorepo::Cli::Configuration do
|
|
15
15
|
|
16
16
|
it "should return default request_num" do
|
17
17
|
default_request_num = conf.send(:defaults)["request_num"]["general"]
|
18
|
-
conf.request_num("all").
|
18
|
+
expect(conf.request_num("all")).to eq(default_request_num)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -24,7 +24,7 @@ describe Nicorepo::Cli::Configuration do
|
|
24
24
|
let(:config_values) { { "request_num" => { "general" => general_request_num } } }
|
25
25
|
|
26
26
|
it "should return defined 'general' request_num" do
|
27
|
-
conf.request_num("all").
|
27
|
+
expect(conf.request_num("all")).to eq(general_request_num)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -35,7 +35,7 @@ describe Nicorepo::Cli::Configuration do
|
|
35
35
|
let(:config_values) { { "request_num" => { "all" => all_request_num } } }
|
36
36
|
|
37
37
|
it "should return defined 'all' request_num" do
|
38
|
-
conf.request_num("all").
|
38
|
+
expect(conf.request_num("all")).to eq(all_request_num)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -45,7 +45,7 @@ describe Nicorepo::Cli::Configuration do
|
|
45
45
|
let(:config_values) { { "request_num" => { "all" => all_request_num, "general" => general_request_num } } }
|
46
46
|
|
47
47
|
it "should return defined 'all' request_num" do
|
48
|
-
conf.request_num("all").
|
48
|
+
expect(conf.request_num("all")).to eq(all_request_num)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -61,7 +61,7 @@ describe Nicorepo::Cli::Configuration do
|
|
61
61
|
let(:config_values) { { "limit_page" => { "all" => all_limit_page, "general" => general_limit_page } } }
|
62
62
|
|
63
63
|
it "should return defined 'all' limit_page" do
|
64
|
-
conf.limit_page("all").
|
64
|
+
expect(conf.limit_page("all")).to eq(all_limit_page)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
data/spec/nicorepo_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe Nicorepo do
|
|
10
10
|
describe "#login" do
|
11
11
|
context "with right account" do
|
12
12
|
it "should be success" do
|
13
|
-
@nicorepo.agent.
|
13
|
+
expect(@nicorepo.agent).to be_truthy
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -25,13 +25,13 @@ describe Nicorepo do
|
|
25
25
|
describe "#all" do
|
26
26
|
context "with 5" do
|
27
27
|
it "should return 5 reports" do
|
28
|
-
@nicorepo.all(5).
|
28
|
+
expect(@nicorepo.all(5).size).to eq(5)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
context "with 50" do
|
33
33
|
it "should return 50 reports" do
|
34
|
-
@nicorepo.all(50).
|
34
|
+
expect(@nicorepo.all(50).size).to eq(50)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -41,11 +41,11 @@ describe Nicorepo do
|
|
41
41
|
it "should return only video reports" do
|
42
42
|
videos = @nicorepo.videos
|
43
43
|
not_videos = videos.reject{ |v| v.kind =~ /video/ }
|
44
|
-
not_videos.size.
|
44
|
+
expect(not_videos.size).to eq(0)
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should return 5 reports at the most" do
|
48
|
-
@nicorepo.videos(5, 3).
|
48
|
+
expect(@nicorepo.videos(5, 3).size).to be <= 5
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -54,7 +54,7 @@ describe Nicorepo do
|
|
54
54
|
it "should return only live reports" do
|
55
55
|
lives = @nicorepo.lives
|
56
56
|
not_lives = lives.reject{ |l| l.kind =~ /live/ }
|
57
|
-
not_lives.size.
|
57
|
+
expect(not_lives.size).to eq(0)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nicorepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- upinetree
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|