filmaffinity 0.3.1 → 1.0.0

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.
@@ -1,45 +1,45 @@
1
- require_relative "../spec_helper"
2
- require_relative "matchers/include-movie"
1
+ require_relative '../spec_helper'
2
+ require_relative 'matchers/include-movie'
3
3
 
4
- describe "FilmAffinity::Search" do
5
- describe "#create_document_html" do
6
- subject(:search) { FilmAffinity::Search.new("truman") }
4
+ describe 'FilmAffinity::Search' do
5
+ describe '#create_document_html' do
6
+ subject(:search) { FilmAffinity::Search.new('truman') }
7
7
 
8
- it "#create_document_html" do
8
+ it '#create_document_html' do
9
9
  document_html = search.document_html
10
10
  expect(document_html).to be_an(Nokogiri::HTML::Document)
11
11
  end
12
12
  end
13
13
 
14
- describe "#movies" do
15
- subject(:search) { FilmAffinity::Search.new("truman") }
14
+ describe '#movies' do
15
+ subject(:search) { FilmAffinity::Search.new('truman') }
16
16
 
17
- it "should return an array" do
17
+ it 'should return an array' do
18
18
  movies = search.movies
19
19
  expect(movies).to be_an(Array)
20
20
  end
21
- it "should return just FilmAffinity::Movie objects only" do
21
+ it 'should return just FilmAffinity::Movie objects only' do
22
22
  movies = search.movies
23
23
  movies.each { |movie| expect(movie).to be_an(FilmAffinity::Movie) }
24
24
  end
25
- it "should include 'Truman Show'" do
25
+ it 'should include "Truman Show"' do
26
26
  movies = search.movies
27
- truman_movie = FilmAffinity::Movie.new(504_889, "El show de Truman (Una vida en directo)")
27
+ truman_movie = FilmAffinity::Movie.new(504_889, 'El show de Truman (Una vida en directo)')
28
28
  expect(movies).to include_movie(truman_movie)
29
29
  end
30
30
  end
31
31
 
32
- describe "#parse_movie" do
32
+ describe '#parse_movie' do
33
33
  # Get a direct result from a specific searchs
34
- subject(:search) { FilmAffinity::Search.new("truman show") }
34
+ subject(:search) { FilmAffinity::Search.new('truman show') }
35
35
 
36
- it "should parse id" do
36
+ it 'should parse id' do
37
37
  id = 504_889
38
38
  expect(id).to eq(search.movies.first.id)
39
39
  end
40
40
 
41
- it "should parse title" do
42
- title = "El show de Truman (Una vida en directo) (1998)"
41
+ it 'should parse title' do
42
+ title = 'El show de Truman (Una vida en directo) (1998)'
43
43
  expect(title).to eq(search.movies.first.title)
44
44
  end
45
45
  end
@@ -1,87 +1,86 @@
1
- require_relative "../spec_helper"
2
- require "pry"
1
+ require_relative '../spec_helper'
3
2
 
4
- describe "FilmAffinity::Top" do
5
- describe "#create_document_html" do
3
+ describe 'FilmAffinity::Top' do
4
+ describe '#create_document_html' do
6
5
  subject(:top) { FilmAffinity::Top.new }
7
6
 
8
- it "#create_document_html" do
7
+ it '#create_document_html' do
9
8
  document_html = top.document_html 0
10
9
  expect(document_html).to respond_to(:search)
11
10
  end
12
11
  end
13
12
 
14
- describe "#movies" do
15
- context "no options" do
13
+ describe '#movies' do
14
+ context 'no options' do
16
15
  subject(:top) { FilmAffinity::Top.new }
17
- it "should return an array" do
16
+ it 'should return an array' do
18
17
  movies = top.movies
19
18
  expect(movies).to be_an(Array)
20
19
  end
21
- it "should return just FilmAffinity::Movie objects only" do
20
+ it 'should return just FilmAffinity::Movie objects only' do
22
21
  movies = top.movies
23
22
  movies.each { |movie| expect(movie).to be_an(FilmAffinity::Movie) }
24
23
  end
25
- it "should include 'El Padrino'" do
24
+ it 'should include "El Padrino"' do
26
25
  movies = top.movies
27
- el_padrino_movie = FilmAffinity::Movie.new(809_297, "El padrino")
26
+ el_padrino_movie = FilmAffinity::Movie.new(809_297, 'El padrino')
28
27
  expect(movies).to include_movie(el_padrino_movie)
29
28
  end
30
- it "should return 30 movies" do
29
+ it 'should return 30 movies' do
31
30
  movies = top.movies
32
31
  expect(movies.size).to eq(30)
33
32
  end
34
33
  end
35
- context "with options" do
34
+ context 'with options' do
36
35
  options = {
37
- genre: "BE",
38
- country: "DE"
36
+ genre: 'BE',
37
+ country: 'DE'
39
38
  }
40
39
  subject(:top) { FilmAffinity::Top.new options: options }
41
- it "should return an array" do
40
+ it 'should return an array' do
42
41
  movies = top.movies
43
42
  expect(movies).to be_an(Array)
44
43
  end
45
- it "should return just FilmAffinity::Movie objects only" do
44
+ it 'should return just FilmAffinity::Movie objects only' do
46
45
  movies = top.movies
47
46
  movies.each { |movie| expect(movie).to be_an(FilmAffinity::Movie) }
48
47
  end
49
- it "should include 'Hijos del Tercer Reich (TV)'" do
48
+ it 'should include "Hijos del Tercer Reich (TV)"' do
50
49
  movies = top.movies
51
- hijos_del_tercer_reich_movie = FilmAffinity::Movie.new(831_118, "Hijos del Tercer Reich (TV)")
52
- expect(movies).to include_movie(hijos_del_tercer_reich_movie)
50
+ hijos = FilmAffinity::Movie.new(831_118, 'Hijos del Tercer Reich (TV)')
51
+ expect(movies).to include_movie(hijos)
53
52
  end
54
53
  end
55
- context "with limit 60" do
54
+ context 'with limit 60' do
56
55
  limit = 60
57
56
  subject(:top) { FilmAffinity::Top.new limit: limit }
58
- it "should include 'American History X'" do
57
+ it 'should include "American History X"' do
59
58
  movies = top.movies
60
- american_history_x = FilmAffinity::Movie.new(261_972, "American History X")
59
+ american_history_x = FilmAffinity::Movie.new(261_972, 'American History X')
61
60
  expect(movies).to include_movie(american_history_x)
62
61
  end
63
- it "should NOT include 'Con la muerte en los talones'" do
62
+ it 'should NOT include "Con la muerte en los talones"' do
64
63
  movies = top.movies
65
- con_la_muerte_en_los_talones = FilmAffinity::Movie.new(351_704, "Con la muerte en los talones")
66
- expect(movies).not_to include_movie(con_la_muerte_en_los_talones)
64
+ con_movie = FilmAffinity::Movie.new(351_704, 'Con la muerte en los talones')
65
+ expect(movies).not_to include_movie(con_movie)
67
66
  end
68
- it "should return 60 movies" do
67
+ it 'should return 60 movies' do
69
68
  movies = top.movies
70
69
  expect(movies.size).to eq(60)
71
70
  end
72
71
  end
73
- context "with limit 132" do
72
+ context 'with limit 132' do
74
73
  limit = 132
75
74
  subject(:top) { FilmAffinity::Top.new limit: limit }
76
- it "should return 132 movies" do
75
+ it 'should return 132 movies' do
77
76
  movies = top.movies
78
77
  expect(movies.size).to eq(132)
79
78
  end
80
79
  end
81
- context "with limit 10" do
80
+ context 'with limit 10' do
82
81
  limit = 10
83
82
  subject(:top) { FilmAffinity::Top.new limit: limit }
84
- it "should return 10 movies" do
83
+ it 'should return 10 movies' do
85
84
  movies = top.movies
86
85
  expect(movies.size).to eq(10)
87
86
  end
@@ -1,3 +1,3 @@
1
1
  require 'rspec'
2
- $LOAD_PATH.unshift(File.dirname(__FILE__) + "/../lib")
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
3
3
  require 'filmaffinity'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filmaffinity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santos
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-19 00:00:00.000000000 Z
12
+ date: 2016-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri