-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34af380
commit 0fb4c78
Showing
10 changed files
with
138 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ gem "rake", "~> 13.0" | |
gem "rspec", "~> 3.0" | ||
|
||
gem "rubocop", "~> 1.21" | ||
|
||
gem 'pry', '~> 0.14.2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
open_weather_aemet (0.1.0) | ||
rake (~> 13.0) | ||
rspec (~> 3.0) | ||
rubocop (~> 1.21) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
ast (2.4.2) | ||
coderay (1.1.3) | ||
diff-lcs (1.5.1) | ||
json (2.7.2) | ||
language_server-protocol (3.17.0.3) | ||
method_source (1.1.0) | ||
parallel (1.24.0) | ||
parser (3.3.1.0) | ||
ast (~> 2.4.1) | ||
racc | ||
pry (0.14.2) | ||
coderay (~> 1.1) | ||
method_source (~> 1.0) | ||
racc (1.7.3) | ||
rainbow (3.1.1) | ||
rake (13.2.1) | ||
regexp_parser (2.9.0) | ||
rexml (3.2.6) | ||
rspec (3.13.0) | ||
rspec-core (~> 3.13.0) | ||
rspec-expectations (~> 3.13.0) | ||
rspec-mocks (~> 3.13.0) | ||
rspec-core (3.13.0) | ||
rspec-support (~> 3.13.0) | ||
rspec-expectations (3.13.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.13.0) | ||
rspec-mocks (3.13.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.13.0) | ||
rspec-support (3.13.1) | ||
rubocop (1.63.4) | ||
json (~> 2.3) | ||
language_server-protocol (>= 3.17.0) | ||
parallel (~> 1.10) | ||
parser (>= 3.3.0.2) | ||
rainbow (>= 2.2.2, < 4.0) | ||
regexp_parser (>= 1.8, < 3.0) | ||
rexml (>= 3.2.5, < 4.0) | ||
rubocop-ast (>= 1.31.1, < 2.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (>= 2.4.0, < 3.0) | ||
rubocop-ast (1.31.3) | ||
parser (>= 3.3.1.0) | ||
ruby-progressbar (1.13.0) | ||
unicode-display_width (2.5.0) | ||
|
||
PLATFORMS | ||
arm64-darwin-21 | ||
|
||
DEPENDENCIES | ||
open_weather_aemet! | ||
pry (~> 0.14.2) | ||
rake (~> 13.0) | ||
rspec (~> 3.0) | ||
rubocop (~> 1.21) | ||
|
||
BUNDLED WITH | ||
2.3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: true | ||
|
||
require "open_weather_aemet" | ||
|
||
RSpec.describe OpenWeatherAemet::Weather do | ||
describe ".forecast_by_api_url" do | ||
context "with valid API URL and API key" do | ||
let(:api_url) { "https://api.example.com" } | ||
let(:api_key) { "API_KEY" } | ||
|
||
it "calls the DataResponse service" do | ||
expect_any_instance_of(ApiAemet::DataResponse).to receive(:call).and_return("Response data") | ||
response = described_class.forecast_by_api_url(api_url, api_key) | ||
expect(response).to eq("Response data") | ||
end | ||
end | ||
|
||
context "with invalid inputs" do | ||
it 'returns "Invalid inputs"' do | ||
response = described_class.forecast_by_api_url(nil, nil) | ||
expect(response).to eq("Invalid inputs") | ||
end | ||
end | ||
end | ||
|
||
describe ".forecast_by_city" do | ||
context "when city_code or API key is not valid for Aemet API" do | ||
let(:city_code) { 5890 } | ||
let(:api_key) { "FAKE_API_KEY" } | ||
|
||
it "calls the DataResponse service" do | ||
expect_any_instance_of(ApiAemet::DataResponse).to receive(:call).and_return("Response data") | ||
response = described_class.forecast_by_city(city_code, api_key) | ||
expect(response).to eq("Invalid data") | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.