aylien_news_api 0.0.1
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 +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +67 -0
- data/LICENSE +13 -0
- data/README.md +133 -0
- data/Rakefile +8 -0
- data/aylien_news_api.gemspec +33 -0
- data/docs/Author.md +10 -0
- data/docs/Autocomplete.md +9 -0
- data/docs/Autocompletes.md +8 -0
- data/docs/Category.md +13 -0
- data/docs/CategoryLinks.md +9 -0
- data/docs/Coverages.md +12 -0
- data/docs/DefaultApi.md +829 -0
- data/docs/Entities.md +9 -0
- data/docs/Entity.md +12 -0
- data/docs/EntityLinks.md +8 -0
- data/docs/Error.md +13 -0
- data/docs/ErrorLinks.md +8 -0
- data/docs/Errors.md +8 -0
- data/docs/HistogramInterval.md +9 -0
- data/docs/Histograms.md +12 -0
- data/docs/Location.md +10 -0
- data/docs/Media.md +9 -0
- data/docs/RelatedStories.md +11 -0
- data/docs/Scope.md +11 -0
- data/docs/Sentiment.md +9 -0
- data/docs/Sentiments.md +9 -0
- data/docs/ShareCount.md +9 -0
- data/docs/ShareCounts.md +11 -0
- data/docs/Source.md +13 -0
- data/docs/Stories.md +10 -0
- data/docs/Story.md +27 -0
- data/docs/StoryCluster.md +12 -0
- data/docs/StoryLinks.md +10 -0
- data/docs/Summary.md +8 -0
- data/docs/TimeSeries.md +9 -0
- data/docs/TimeSeriesList.md +11 -0
- data/docs/Trend.md +9 -0
- data/docs/Trends.md +9 -0
- data/lib/aylien_news_api.rb +74 -0
- data/lib/aylien_news_api/api/default_api.rb +1171 -0
- data/lib/aylien_news_api/api_client.rb +365 -0
- data/lib/aylien_news_api/api_error.rb +38 -0
- data/lib/aylien_news_api/configuration.rb +191 -0
- data/lib/aylien_news_api/models/author.rb +192 -0
- data/lib/aylien_news_api/models/autocomplete.rb +183 -0
- data/lib/aylien_news_api/models/autocompletes.rb +176 -0
- data/lib/aylien_news_api/models/category.rb +229 -0
- data/lib/aylien_news_api/models/category_links.rb +183 -0
- data/lib/aylien_news_api/models/coverages.rb +212 -0
- data/lib/aylien_news_api/models/entities.rb +187 -0
- data/lib/aylien_news_api/models/entity.rb +214 -0
- data/lib/aylien_news_api/models/entity_links.rb +174 -0
- data/lib/aylien_news_api/models/error.rb +213 -0
- data/lib/aylien_news_api/models/error_links.rb +173 -0
- data/lib/aylien_news_api/models/errors.rb +175 -0
- data/lib/aylien_news_api/models/histogram_interval.rb +183 -0
- data/lib/aylien_news_api/models/histograms.rb +211 -0
- data/lib/aylien_news_api/models/location.rb +192 -0
- data/lib/aylien_news_api/models/media.rb +193 -0
- data/lib/aylien_news_api/models/related_stories.rb +203 -0
- data/lib/aylien_news_api/models/scope.rb +211 -0
- data/lib/aylien_news_api/models/sentiment.rb +193 -0
- data/lib/aylien_news_api/models/sentiments.rb +183 -0
- data/lib/aylien_news_api/models/share_count.rb +183 -0
- data/lib/aylien_news_api/models/share_counts.rb +209 -0
- data/lib/aylien_news_api/models/source.rb +223 -0
- data/lib/aylien_news_api/models/stories.rb +196 -0
- data/lib/aylien_news_api/models/story.rb +353 -0
- data/lib/aylien_news_api/models/story_cluster.rb +214 -0
- data/lib/aylien_news_api/models/story_links.rb +192 -0
- data/lib/aylien_news_api/models/summary.rb +176 -0
- data/lib/aylien_news_api/models/time_series.rb +183 -0
- data/lib/aylien_news_api/models/time_series_list.rb +203 -0
- data/lib/aylien_news_api/models/trend.rb +183 -0
- data/lib/aylien_news_api/models/trends.rb +185 -0
- data/lib/aylien_news_api/version.rb +17 -0
- data/spec/api/default_api_spec.rb +357 -0
- data/spec/models/author_spec.rb +66 -0
- data/spec/models/autocomplete_spec.rb +56 -0
- data/spec/models/autocompletes_spec.rb +46 -0
- data/spec/models/category_links_spec.rb +56 -0
- data/spec/models/category_spec.rb +96 -0
- data/spec/models/coverages_spec.rb +86 -0
- data/spec/models/entities_spec.rb +56 -0
- data/spec/models/entity_links_spec.rb +46 -0
- data/spec/models/entity_spec.rb +86 -0
- data/spec/models/error_links_spec.rb +46 -0
- data/spec/models/error_spec.rb +96 -0
- data/spec/models/errors_spec.rb +46 -0
- data/spec/models/histogram_interval_spec.rb +56 -0
- data/spec/models/histograms_spec.rb +86 -0
- data/spec/models/location_spec.rb +66 -0
- data/spec/models/media_spec.rb +56 -0
- data/spec/models/related_stories_spec.rb +76 -0
- data/spec/models/scope_spec.rb +76 -0
- data/spec/models/sentiment_spec.rb +56 -0
- data/spec/models/sentiments_spec.rb +56 -0
- data/spec/models/share_count_spec.rb +56 -0
- data/spec/models/share_counts_spec.rb +76 -0
- data/spec/models/source_spec.rb +96 -0
- data/spec/models/stories_spec.rb +66 -0
- data/spec/models/story_cluster_spec.rb +86 -0
- data/spec/models/story_links_spec.rb +66 -0
- data/spec/models/story_spec.rb +236 -0
- data/spec/models/summary_spec.rb +46 -0
- data/spec/models/time_series_list_spec.rb +76 -0
- data/spec/models/time_series_spec.rb +56 -0
- data/spec/models/trend_spec.rb +56 -0
- data/spec/models/trends_spec.rb +56 -0
- metadata +391 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright 2016 Aylien, Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
module AylienNewsApi
|
|
16
|
+
VERSION = "0.0.1"
|
|
17
|
+
end
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# Copyright 2016 Aylien, Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
require 'spec_helper'
|
|
16
|
+
require 'json'
|
|
17
|
+
|
|
18
|
+
# Unit tests for AylienNewsApi::DefaultApi
|
|
19
|
+
describe 'DefaultApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = AylienNewsApi::DefaultApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of DefaultApi' do
|
|
30
|
+
it 'should create an instact of DefaultApi' do
|
|
31
|
+
@instance.should be_a(AylienNewsApi::DefaultApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for list_autocompletes
|
|
36
|
+
# List autocompletes
|
|
37
|
+
# This endpoint is used for getting list of autocompletes by providing a specific term and type.
|
|
38
|
+
# @param type This parameter is used for defining the type of autocompletes.
|
|
39
|
+
# @param term This parameter is used for finding autocomplete objects whose contains the specified value.
|
|
40
|
+
# @param [Hash] opts the optional parameters
|
|
41
|
+
# @option opts [String] :language This parameter is used for autocompletes whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
42
|
+
# @option opts [Integer] :per_page This parameter is used for specifying number of the items in each page.
|
|
43
|
+
# @return [Autocompletes]
|
|
44
|
+
describe 'list_autocompletes test' do
|
|
45
|
+
it "should work" do
|
|
46
|
+
# assertion here
|
|
47
|
+
# should be_a()
|
|
48
|
+
# should be_nil
|
|
49
|
+
# should ==
|
|
50
|
+
# should_not ==
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# unit tests for list_coverages
|
|
55
|
+
# List coverages
|
|
56
|
+
# This endpoint is used for finding story coverages based on provided parameters. The number of coverages to return, up to a maximum of 100.
|
|
57
|
+
# @param [Hash] opts the optional parameters
|
|
58
|
+
# @option opts [Array<Integer>] :id This parameter is used for finding stroies by story id.
|
|
59
|
+
# @option opts [String] :title This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
60
|
+
# @option opts [String] :body This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
61
|
+
# @option opts [String] :text This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
62
|
+
# @option opts [Array<String>] :language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
63
|
+
# @option opts [String] :published_at_start This parameter is used for finding stories whose published at is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
64
|
+
# @option opts [String] :published_at_end This parameter is used for finding stories whose published at is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
65
|
+
# @option opts [String] :categories_taxonomy This parameter is used for defining type of the taxonomy for the rest of categories queries.
|
|
66
|
+
# @option opts [BOOLEAN] :categories_confident This parameter is used for finding stories whose categories are confident.
|
|
67
|
+
# @option opts [Array<String>] :categories_id This parameter is used for finding stories whose categories id is the specified value.
|
|
68
|
+
# @option opts [Array<Integer>] :categories_level This parameter is used for finding stories whose categories level is the specified value.
|
|
69
|
+
# @option opts [Array<String>] :entities_title_text This parameter is used for finding stories whose entities text in title is the specified value.
|
|
70
|
+
# @option opts [Array<String>] :entities_title_type This parameter is used for finding stories whose entities type in title is the specified value.
|
|
71
|
+
# @option opts [Array<String>] :entities_title_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in title is the specified value.
|
|
72
|
+
# @option opts [Array<String>] :entities_body_text This parameter is used for finding stories whose entities text in body is the specified value.
|
|
73
|
+
# @option opts [Array<String>] :entities_body_type This parameter is used for finding stories whose entities type in body is the specified value.
|
|
74
|
+
# @option opts [Array<String>] :entities_body_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in body is the specified value.
|
|
75
|
+
# @option opts [String] :sentiment_title_polarity This parameter is used for finding stories whose title sentiment is the specified value.
|
|
76
|
+
# @option opts [String] :sentiment_body_polarity This parameter is used for finding stories whose body sentiment is the specified value.
|
|
77
|
+
# @option opts [Array<Integer>] :author_id This parameter is used for finding stories whose author id is the specified value.
|
|
78
|
+
# @option opts [String] :author_name This parameter is used for finding stories whose author full name contains the specified value.
|
|
79
|
+
# @option opts [Array<Integer>] :source_id This parameter is used for finding stories whose source id is the specified value.
|
|
80
|
+
# @option opts [Array<String>] :source_name This parameter is used for finding stories whose source name contains the specified value.
|
|
81
|
+
# @option opts [Array<String>] :source_domain This parameter is used for finding stories whose source domain is the specified value.
|
|
82
|
+
# @option opts [Array<String>] :source_locations_country This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
83
|
+
# @option opts [Array<String>] :source_locations_state This parameter is used for finding stories whose source state/province is the specified value.
|
|
84
|
+
# @option opts [Array<String>] :source_locations_city This parameter is used for finding stories whose source city is the specified value.
|
|
85
|
+
# @option opts [Array<String>] :source_scopes_country This parameter is used for finding stories whose source scopes country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
86
|
+
# @option opts [Array<String>] :source_scopes_state This parameter is used for finding stories whose source scopes state/province is the specified value.
|
|
87
|
+
# @option opts [Array<String>] :source_scopes_city This parameter is used for finding stories whose source scopes city is the specified value.
|
|
88
|
+
# @option opts [Array<String>] :source_scopes_level This parameter is used for finding stories whose source scopes level is the specified value.
|
|
89
|
+
# @option opts [Integer] :story_id A story id
|
|
90
|
+
# @option opts [String] :story_url An article or webpage
|
|
91
|
+
# @option opts [String] :story_title Title of the article
|
|
92
|
+
# @option opts [String] :story_body Body of the article
|
|
93
|
+
# @option opts [DateTime] :story_published_at Publish date of the article. If you use url or title and body for getting coverages, this parameter is required. The format used is a restricted form of the canonical representation of dateTime in the [XML Schema specification (ISO 8601)](https://www.w3.org/TR/xmlschema-2/#dateTime).
|
|
94
|
+
# @option opts [String] :story_language This parameter is used for setting language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
95
|
+
# @option opts [Integer] :per_page This parameter is used for specifying number of the items in each page.
|
|
96
|
+
# @return [Coverages]
|
|
97
|
+
describe 'list_coverages test' do
|
|
98
|
+
it "should work" do
|
|
99
|
+
# assertion here
|
|
100
|
+
# should be_a()
|
|
101
|
+
# should be_nil
|
|
102
|
+
# should ==
|
|
103
|
+
# should_not ==
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# unit tests for list_histograms
|
|
108
|
+
# List histograms
|
|
109
|
+
# This endpoint is used for getting histograms based on the field parameter is passed.
|
|
110
|
+
# @param [Hash] opts the optional parameters
|
|
111
|
+
# @option opts [Array<Integer>] :id This parameter is used for finding stroies by story id.
|
|
112
|
+
# @option opts [String] :title This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
113
|
+
# @option opts [String] :body This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
114
|
+
# @option opts [String] :text This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
115
|
+
# @option opts [Array<String>] :language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
116
|
+
# @option opts [String] :published_at_start This parameter is used for finding stories whose published at is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
117
|
+
# @option opts [String] :published_at_end This parameter is used for finding stories whose published at is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
118
|
+
# @option opts [String] :categories_taxonomy This parameter is used for defining type of the taxonomy for the rest of categories queries.
|
|
119
|
+
# @option opts [BOOLEAN] :categories_confident This parameter is used for finding stories whose categories are confident.
|
|
120
|
+
# @option opts [Array<String>] :categories_id This parameter is used for finding stories whose categories id is the specified value.
|
|
121
|
+
# @option opts [Array<Integer>] :categories_level This parameter is used for finding stories whose categories level is the specified value.
|
|
122
|
+
# @option opts [Array<String>] :entities_title_text This parameter is used for finding stories whose entities text in title is the specified value.
|
|
123
|
+
# @option opts [Array<String>] :entities_title_type This parameter is used for finding stories whose entities type in title is the specified value.
|
|
124
|
+
# @option opts [Array<String>] :entities_title_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in title is the specified value.
|
|
125
|
+
# @option opts [Array<String>] :entities_body_text This parameter is used for finding stories whose entities text in body is the specified value.
|
|
126
|
+
# @option opts [Array<String>] :entities_body_type This parameter is used for finding stories whose entities type in body is the specified value.
|
|
127
|
+
# @option opts [Array<String>] :entities_body_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in body is the specified value.
|
|
128
|
+
# @option opts [String] :sentiment_title_polarity This parameter is used for finding stories whose title sentiment is the specified value.
|
|
129
|
+
# @option opts [String] :sentiment_body_polarity This parameter is used for finding stories whose body sentiment is the specified value.
|
|
130
|
+
# @option opts [Array<Integer>] :author_id This parameter is used for finding stories whose author id is the specified value.
|
|
131
|
+
# @option opts [String] :author_name This parameter is used for finding stories whose author full name contains the specified value.
|
|
132
|
+
# @option opts [Array<Integer>] :source_id This parameter is used for finding stories whose source id is the specified value.
|
|
133
|
+
# @option opts [Array<String>] :source_name This parameter is used for finding stories whose source name contains the specified value.
|
|
134
|
+
# @option opts [Array<String>] :source_domain This parameter is used for finding stories whose source domain is the specified value.
|
|
135
|
+
# @option opts [Array<String>] :source_locations_country This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
136
|
+
# @option opts [Array<String>] :source_locations_state This parameter is used for finding stories whose source state/province is the specified value.
|
|
137
|
+
# @option opts [Array<String>] :source_locations_city This parameter is used for finding stories whose source city is the specified value.
|
|
138
|
+
# @option opts [Array<String>] :source_scopes_country This parameter is used for finding stories whose source scopes country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
139
|
+
# @option opts [Array<String>] :source_scopes_state This parameter is used for finding stories whose source scopes state/province is the specified value.
|
|
140
|
+
# @option opts [Array<String>] :source_scopes_city This parameter is used for finding stories whose source scopes city is the specified value.
|
|
141
|
+
# @option opts [Array<String>] :source_scopes_level This parameter is used for finding stories whose source scopes level is the specified value.
|
|
142
|
+
# @option opts [Integer] :interval_start This parameter is used for setting the start data point of histogram intervals.
|
|
143
|
+
# @option opts [Integer] :interval_end This parameter is used for setting the end data point of histogram intervals.
|
|
144
|
+
# @option opts [Integer] :interval_width This parameter is used for setting the width of histogram intervals.
|
|
145
|
+
# @option opts [String] :field This parameter is used for specifying the y-axis variable for the histogram.
|
|
146
|
+
# @return [Histograms]
|
|
147
|
+
describe 'list_histograms test' do
|
|
148
|
+
it "should work" do
|
|
149
|
+
# assertion here
|
|
150
|
+
# should be_a()
|
|
151
|
+
# should be_nil
|
|
152
|
+
# should ==
|
|
153
|
+
# should_not ==
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# unit tests for list_related_stories
|
|
158
|
+
# List related stories
|
|
159
|
+
# This endpoint is used for finding related stories based on provided parameters. The number of related stories to return, up to a maximum of 100.
|
|
160
|
+
# @param [Hash] opts the optional parameters
|
|
161
|
+
# @option opts [Array<Integer>] :id This parameter is used for finding stroies by story id.
|
|
162
|
+
# @option opts [String] :title This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
163
|
+
# @option opts [String] :body This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
164
|
+
# @option opts [String] :text This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
165
|
+
# @option opts [Array<String>] :language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
166
|
+
# @option opts [String] :published_at_start This parameter is used for finding stories whose published at is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
167
|
+
# @option opts [String] :published_at_end This parameter is used for finding stories whose published at is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
168
|
+
# @option opts [String] :categories_taxonomy This parameter is used for defining type of the taxonomy for the rest of categories queries.
|
|
169
|
+
# @option opts [BOOLEAN] :categories_confident This parameter is used for finding stories whose categories are confident.
|
|
170
|
+
# @option opts [Array<String>] :categories_id This parameter is used for finding stories whose categories id is the specified value.
|
|
171
|
+
# @option opts [Array<Integer>] :categories_level This parameter is used for finding stories whose categories level is the specified value.
|
|
172
|
+
# @option opts [Array<String>] :entities_title_text This parameter is used for finding stories whose entities text in title is the specified value.
|
|
173
|
+
# @option opts [Array<String>] :entities_title_type This parameter is used for finding stories whose entities type in title is the specified value.
|
|
174
|
+
# @option opts [Array<String>] :entities_title_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in title is the specified value.
|
|
175
|
+
# @option opts [Array<String>] :entities_body_text This parameter is used for finding stories whose entities text in body is the specified value.
|
|
176
|
+
# @option opts [Array<String>] :entities_body_type This parameter is used for finding stories whose entities type in body is the specified value.
|
|
177
|
+
# @option opts [Array<String>] :entities_body_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in body is the specified value.
|
|
178
|
+
# @option opts [String] :sentiment_title_polarity This parameter is used for finding stories whose title sentiment is the specified value.
|
|
179
|
+
# @option opts [String] :sentiment_body_polarity This parameter is used for finding stories whose body sentiment is the specified value.
|
|
180
|
+
# @option opts [Array<Integer>] :author_id This parameter is used for finding stories whose author id is the specified value.
|
|
181
|
+
# @option opts [String] :author_name This parameter is used for finding stories whose author full name contains the specified value.
|
|
182
|
+
# @option opts [Array<Integer>] :source_id This parameter is used for finding stories whose source id is the specified value.
|
|
183
|
+
# @option opts [Array<String>] :source_name This parameter is used for finding stories whose source name contains the specified value.
|
|
184
|
+
# @option opts [Array<String>] :source_domain This parameter is used for finding stories whose source domain is the specified value.
|
|
185
|
+
# @option opts [Array<String>] :source_locations_country This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
186
|
+
# @option opts [Array<String>] :source_locations_state This parameter is used for finding stories whose source state/province is the specified value.
|
|
187
|
+
# @option opts [Array<String>] :source_locations_city This parameter is used for finding stories whose source city is the specified value.
|
|
188
|
+
# @option opts [Array<String>] :source_scopes_country This parameter is used for finding stories whose source scopes country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
189
|
+
# @option opts [Array<String>] :source_scopes_state This parameter is used for finding stories whose source scopes state/province is the specified value.
|
|
190
|
+
# @option opts [Array<String>] :source_scopes_city This parameter is used for finding stories whose source scopes city is the specified value.
|
|
191
|
+
# @option opts [Array<String>] :source_scopes_level This parameter is used for finding stories whose source scopes level is the specified value.
|
|
192
|
+
# @option opts [Integer] :story_id A story id
|
|
193
|
+
# @option opts [String] :story_url An article or webpage
|
|
194
|
+
# @option opts [String] :story_title Title of the article
|
|
195
|
+
# @option opts [String] :story_body Body of the article
|
|
196
|
+
# @option opts [String] :boost_by This parameter is used for boosting result by the specified value.
|
|
197
|
+
# @option opts [String] :story_language This parameter is used for setting language of the story. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
198
|
+
# @option opts [Integer] :per_page This parameter is used for specifying number of the items in each page.
|
|
199
|
+
# @return [RelatedStories]
|
|
200
|
+
describe 'list_related_stories test' do
|
|
201
|
+
it "should work" do
|
|
202
|
+
# assertion here
|
|
203
|
+
# should be_a()
|
|
204
|
+
# should be_nil
|
|
205
|
+
# should ==
|
|
206
|
+
# should_not ==
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# unit tests for list_stories
|
|
211
|
+
# List Stories
|
|
212
|
+
# This endpoint is used for getting list of stories.
|
|
213
|
+
# @param [Hash] opts the optional parameters
|
|
214
|
+
# @option opts [Array<Integer>] :id This parameter is used for finding stroies by story id.
|
|
215
|
+
# @option opts [String] :title This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
216
|
+
# @option opts [String] :body This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
217
|
+
# @option opts [String] :text This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
218
|
+
# @option opts [Array<String>] :language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
219
|
+
# @option opts [String] :published_at_start This parameter is used for finding stories whose published at is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
220
|
+
# @option opts [String] :published_at_end This parameter is used for finding stories whose published at is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
221
|
+
# @option opts [String] :categories_taxonomy This parameter is used for defining type of the taxonomy for the rest of categories queries.
|
|
222
|
+
# @option opts [BOOLEAN] :categories_confident This parameter is used for finding stories whose categories are confident.
|
|
223
|
+
# @option opts [Array<String>] :categories_id This parameter is used for finding stories whose categories id is the specified value.
|
|
224
|
+
# @option opts [Array<Integer>] :categories_level This parameter is used for finding stories whose categories level is the specified value.
|
|
225
|
+
# @option opts [Array<String>] :entities_title_text This parameter is used for finding stories whose entities text in title is the specified value.
|
|
226
|
+
# @option opts [Array<String>] :entities_title_type This parameter is used for finding stories whose entities type in title is the specified value.
|
|
227
|
+
# @option opts [Array<String>] :entities_title_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in title is the specified value.
|
|
228
|
+
# @option opts [Array<String>] :entities_body_text This parameter is used for finding stories whose entities text in body is the specified value.
|
|
229
|
+
# @option opts [Array<String>] :entities_body_type This parameter is used for finding stories whose entities type in body is the specified value.
|
|
230
|
+
# @option opts [Array<String>] :entities_body_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in body is the specified value.
|
|
231
|
+
# @option opts [String] :sentiment_title_polarity This parameter is used for finding stories whose title sentiment is the specified value.
|
|
232
|
+
# @option opts [String] :sentiment_body_polarity This parameter is used for finding stories whose body sentiment is the specified value.
|
|
233
|
+
# @option opts [Array<Integer>] :author_id This parameter is used for finding stories whose author id is the specified value.
|
|
234
|
+
# @option opts [String] :author_name This parameter is used for finding stories whose author full name contains the specified value.
|
|
235
|
+
# @option opts [Array<Integer>] :source_id This parameter is used for finding stories whose source id is the specified value.
|
|
236
|
+
# @option opts [Array<String>] :source_name This parameter is used for finding stories whose source name contains the specified value.
|
|
237
|
+
# @option opts [Array<String>] :source_domain This parameter is used for finding stories whose source domain is the specified value.
|
|
238
|
+
# @option opts [Array<String>] :source_locations_country This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
239
|
+
# @option opts [Array<String>] :source_locations_state This parameter is used for finding stories whose source state/province is the specified value.
|
|
240
|
+
# @option opts [Array<String>] :source_locations_city This parameter is used for finding stories whose source city is the specified value.
|
|
241
|
+
# @option opts [Array<String>] :source_scopes_country This parameter is used for finding stories whose source scopes country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
242
|
+
# @option opts [Array<String>] :source_scopes_state This parameter is used for finding stories whose source scopes state/province is the specified value.
|
|
243
|
+
# @option opts [Array<String>] :source_scopes_city This parameter is used for finding stories whose source scopes city is the specified value.
|
|
244
|
+
# @option opts [Array<String>] :source_scopes_level This parameter is used for finding stories whose source scopes level is the specified value.
|
|
245
|
+
# @option opts [BOOLEAN] :cluster This parameter enables clustering for the returned stories.
|
|
246
|
+
# @option opts [String] :cluster_algorithm This parameter is used for specifying the clustering algorithm. It supprts STC, Lingo and [k-means](https://en.wikipedia.org/wiki/K-means_clustering) algorithms.
|
|
247
|
+
# @option opts [Array<String>] :_return This parameter is used for specifying return fields.
|
|
248
|
+
# @option opts [String] :sort_by This parameter is used for changing the order column of the result.
|
|
249
|
+
# @option opts [String] :sort_direction This parameter is used for changing the order direction of the result.
|
|
250
|
+
# @option opts [String] :cursor This parameter is used for finding a specific page.
|
|
251
|
+
# @option opts [Integer] :per_page This parameter is used for specifying number of the items in each page.
|
|
252
|
+
# @return [Stories]
|
|
253
|
+
describe 'list_stories test' do
|
|
254
|
+
it "should work" do
|
|
255
|
+
# assertion here
|
|
256
|
+
# should be_a()
|
|
257
|
+
# should be_nil
|
|
258
|
+
# should ==
|
|
259
|
+
# should_not ==
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# unit tests for list_time_series
|
|
264
|
+
# List time series
|
|
265
|
+
# This endpoint is used for getting time series by stories.
|
|
266
|
+
# @param [Hash] opts the optional parameters
|
|
267
|
+
# @option opts [Array<Integer>] :id This parameter is used for finding stroies by story id.
|
|
268
|
+
# @option opts [String] :title This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
269
|
+
# @option opts [String] :body This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
270
|
+
# @option opts [String] :text This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
271
|
+
# @option opts [Array<String>] :language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
272
|
+
# @option opts [String] :categories_taxonomy This parameter is used for defining type of the taxonomy for the rest of categories queries.
|
|
273
|
+
# @option opts [BOOLEAN] :categories_confident This parameter is used for finding stories whose categories are confident.
|
|
274
|
+
# @option opts [Array<String>] :categories_id This parameter is used for finding stories whose categories id is the specified value.
|
|
275
|
+
# @option opts [Array<Integer>] :categories_level This parameter is used for finding stories whose categories level is the specified value.
|
|
276
|
+
# @option opts [Array<String>] :entities_title_text This parameter is used for finding stories whose entities text in title is the specified value.
|
|
277
|
+
# @option opts [Array<String>] :entities_title_type This parameter is used for finding stories whose entities type in title is the specified value.
|
|
278
|
+
# @option opts [Array<String>] :entities_title_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in title is the specified value.
|
|
279
|
+
# @option opts [Array<String>] :entities_body_text This parameter is used for finding stories whose entities text in body is the specified value.
|
|
280
|
+
# @option opts [Array<String>] :entities_body_type This parameter is used for finding stories whose entities type in body is the specified value.
|
|
281
|
+
# @option opts [Array<String>] :entities_body_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in body is the specified value.
|
|
282
|
+
# @option opts [String] :sentiment_title_polarity This parameter is used for finding stories whose title sentiment is the specified value.
|
|
283
|
+
# @option opts [String] :sentiment_body_polarity This parameter is used for finding stories whose body sentiment is the specified value.
|
|
284
|
+
# @option opts [Array<Integer>] :author_id This parameter is used for finding stories whose author id is the specified value.
|
|
285
|
+
# @option opts [String] :author_name This parameter is used for finding stories whose author full name contains the specified value.
|
|
286
|
+
# @option opts [Array<Integer>] :source_id This parameter is used for finding stories whose source id is the specified value.
|
|
287
|
+
# @option opts [Array<String>] :source_name This parameter is used for finding stories whose source name contains the specified value.
|
|
288
|
+
# @option opts [Array<String>] :source_domain This parameter is used for finding stories whose source domain is the specified value.
|
|
289
|
+
# @option opts [Array<String>] :source_locations_country This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
290
|
+
# @option opts [Array<String>] :source_locations_state This parameter is used for finding stories whose source state/province is the specified value.
|
|
291
|
+
# @option opts [Array<String>] :source_locations_city This parameter is used for finding stories whose source city is the specified value.
|
|
292
|
+
# @option opts [Array<String>] :source_scopes_country This parameter is used for finding stories whose source scopes country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
293
|
+
# @option opts [Array<String>] :source_scopes_state This parameter is used for finding stories whose source scopes state/province is the specified value.
|
|
294
|
+
# @option opts [Array<String>] :source_scopes_city This parameter is used for finding stories whose source scopes city is the specified value.
|
|
295
|
+
# @option opts [Array<String>] :source_scopes_level This parameter is used for finding stories whose source scopes level is the specified value.
|
|
296
|
+
# @option opts [String] :published_at_start This parameter is used for finding stories whose published at is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
297
|
+
# @option opts [String] :published_at_end This parameter is used for finding stories whose published at is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
298
|
+
# @option opts [String] :period The size of each date range expressed as an interval to be added to the lower bound. It supports Date Math Syntax. Valid options are `+` following an integer number greater than 0 and one of the Date Math keywords. e.g. `+1DAY`, `+2MINUTES` and `+1MONTH`. Here are [Supported keywords](https://newsapi.aylien.com/docs/working-with-dates#date-math).
|
|
299
|
+
# @return [TimeSeriesList]
|
|
300
|
+
describe 'list_time_series test' do
|
|
301
|
+
it "should work" do
|
|
302
|
+
# assertion here
|
|
303
|
+
# should be_a()
|
|
304
|
+
# should be_nil
|
|
305
|
+
# should ==
|
|
306
|
+
# should_not ==
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# unit tests for list_trends
|
|
311
|
+
# List trends
|
|
312
|
+
# This endpoint is used for finding news trendings based on stories resource.
|
|
313
|
+
# @param [Hash] opts the optional parameters
|
|
314
|
+
# @option opts [Array<Integer>] :id This parameter is used for finding stroies by story id.
|
|
315
|
+
# @option opts [String] :title This parameter is used for finding stories whose title contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
316
|
+
# @option opts [String] :body This parameter is used for finding stories whose body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
317
|
+
# @option opts [String] :text This parameter is used for finding stories whose title or body contains a specfic keyword. It supports [boolean operators](https://newsapi.aylien.com/docs/boolean-operators).
|
|
318
|
+
# @option opts [Array<String>] :language This parameter is used for finding stories whose language is the specified value. It supports [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes.
|
|
319
|
+
# @option opts [String] :published_at_start This parameter is used for finding stories whose published at is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
320
|
+
# @option opts [String] :published_at_end This parameter is used for finding stories whose published at is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
321
|
+
# @option opts [String] :categories_taxonomy This parameter is used for defining type of the taxonomy for the rest of categories queries.
|
|
322
|
+
# @option opts [BOOLEAN] :categories_confident This parameter is used for finding stories whose categories are confident.
|
|
323
|
+
# @option opts [Array<String>] :categories_id This parameter is used for finding stories whose categories id is the specified value.
|
|
324
|
+
# @option opts [Array<Integer>] :categories_level This parameter is used for finding stories whose categories level is the specified value.
|
|
325
|
+
# @option opts [Array<String>] :entities_title_text This parameter is used for finding stories whose entities text in title is the specified value.
|
|
326
|
+
# @option opts [Array<String>] :entities_title_type This parameter is used for finding stories whose entities type in title is the specified value.
|
|
327
|
+
# @option opts [Array<String>] :entities_title_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in title is the specified value.
|
|
328
|
+
# @option opts [Array<String>] :entities_body_text This parameter is used for finding stories whose entities text in body is the specified value.
|
|
329
|
+
# @option opts [Array<String>] :entities_body_type This parameter is used for finding stories whose entities type in body is the specified value.
|
|
330
|
+
# @option opts [Array<String>] :entities_body_links_dbpedia This parameter is used for finding stories whose entities dbpedia url in body is the specified value.
|
|
331
|
+
# @option opts [String] :sentiment_title_polarity This parameter is used for finding stories whose title sentiment is the specified value.
|
|
332
|
+
# @option opts [String] :sentiment_body_polarity This parameter is used for finding stories whose body sentiment is the specified value.
|
|
333
|
+
# @option opts [Array<Integer>] :author_id This parameter is used for finding stories whose author id is the specified value.
|
|
334
|
+
# @option opts [String] :author_name This parameter is used for finding stories whose author full name contains the specified value.
|
|
335
|
+
# @option opts [Array<Integer>] :source_id This parameter is used for finding stories whose source id is the specified value.
|
|
336
|
+
# @option opts [Array<String>] :source_name This parameter is used for finding stories whose source name contains the specified value.
|
|
337
|
+
# @option opts [Array<String>] :source_domain This parameter is used for finding stories whose source domain is the specified value.
|
|
338
|
+
# @option opts [Array<String>] :source_locations_country This parameter is used for finding stories whose source country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
339
|
+
# @option opts [Array<String>] :source_locations_state This parameter is used for finding stories whose source state/province is the specified value.
|
|
340
|
+
# @option opts [Array<String>] :source_locations_city This parameter is used for finding stories whose source city is the specified value.
|
|
341
|
+
# @option opts [Array<String>] :source_scopes_country This parameter is used for finding stories whose source scopes country is the specified value. It supports [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes.
|
|
342
|
+
# @option opts [Array<String>] :source_scopes_state This parameter is used for finding stories whose source scopes state/province is the specified value.
|
|
343
|
+
# @option opts [Array<String>] :source_scopes_city This parameter is used for finding stories whose source scopes city is the specified value.
|
|
344
|
+
# @option opts [Array<String>] :source_scopes_level This parameter is used for finding stories whose source scopes level is the specified value.
|
|
345
|
+
# @option opts [String] :field This parameter is used to specify the trend field.
|
|
346
|
+
# @return [Trends]
|
|
347
|
+
describe 'list_trends test' do
|
|
348
|
+
it "should work" do
|
|
349
|
+
# assertion here
|
|
350
|
+
# should be_a()
|
|
351
|
+
# should be_nil
|
|
352
|
+
# should ==
|
|
353
|
+
# should_not ==
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Copyright 2016 Aylien, Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
require 'spec_helper'
|
|
16
|
+
require 'json'
|
|
17
|
+
require 'date'
|
|
18
|
+
|
|
19
|
+
# Unit tests for AylienNewsApi::Author
|
|
20
|
+
describe 'Author' do
|
|
21
|
+
before do
|
|
22
|
+
# run before each test
|
|
23
|
+
@instance = AylienNewsApi::Author.new
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after do
|
|
27
|
+
# run after each test
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test an instance of Author' do
|
|
31
|
+
it 'should create an instact of Author' do
|
|
32
|
+
@instance.should be_a(AylienNewsApi::Author)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
describe 'test attribute "id"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here
|
|
38
|
+
# should be_a()
|
|
39
|
+
# should be_nil
|
|
40
|
+
# should ==
|
|
41
|
+
# should_not ==
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
describe 'test attribute "name"' do
|
|
46
|
+
it 'should work' do
|
|
47
|
+
# assertion here
|
|
48
|
+
# should be_a()
|
|
49
|
+
# should be_nil
|
|
50
|
+
# should ==
|
|
51
|
+
# should_not ==
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
describe 'test attribute "avatar_url"' do
|
|
56
|
+
it 'should work' do
|
|
57
|
+
# assertion here
|
|
58
|
+
# should be_a()
|
|
59
|
+
# should be_nil
|
|
60
|
+
# should ==
|
|
61
|
+
# should_not ==
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
end
|
|
66
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Copyright 2016 Aylien, Inc. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
require 'spec_helper'
|
|
16
|
+
require 'json'
|
|
17
|
+
require 'date'
|
|
18
|
+
|
|
19
|
+
# Unit tests for AylienNewsApi::Autocomplete
|
|
20
|
+
describe 'Autocomplete' do
|
|
21
|
+
before do
|
|
22
|
+
# run before each test
|
|
23
|
+
@instance = AylienNewsApi::Autocomplete.new
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
after do
|
|
27
|
+
# run after each test
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test an instance of Autocomplete' do
|
|
31
|
+
it 'should create an instact of Autocomplete' do
|
|
32
|
+
@instance.should be_a(AylienNewsApi::Autocomplete)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
describe 'test attribute "id"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here
|
|
38
|
+
# should be_a()
|
|
39
|
+
# should be_nil
|
|
40
|
+
# should ==
|
|
41
|
+
# should_not ==
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
describe 'test attribute "text"' do
|
|
46
|
+
it 'should work' do
|
|
47
|
+
# assertion here
|
|
48
|
+
# should be_a()
|
|
49
|
+
# should be_nil
|
|
50
|
+
# should ==
|
|
51
|
+
# should_not ==
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
|