Skip to content

Commit

Permalink
Add requirements and screenshots specs
Browse files Browse the repository at this point in the history
  • Loading branch information
sosolidkk committed Jun 11, 2024
1 parent c382dad commit fb7e954
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
22 changes: 21 additions & 1 deletion spec/steam_api/structs/app_details/requirements_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,25 @@
RSpec.describe SteamApi::Structs::AppDetails::Requirements do
subject { described_class.new(params) }

pending 'TODO'
describe '#initialize' do
let(:params) do
{
minimum: minimum,
recommended: recommended
}
end

context 'when the params are present' do
let(:minimum) { 'Minimum: OS, RAM' }
let(:recommended) { 'Recommended: OS, RAM, HD' }

it { is_expected.to have_attributes(**params) }
end

context 'when the params are missing' do
let(:params) { {} }

it { is_expected.to have_attributes(minimum: nil, recommended: nil) }
end
end
end
26 changes: 25 additions & 1 deletion spec/steam_api/structs/app_details/screenshot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,29 @@
RSpec.describe SteamApi::Structs::AppDetails::Screenshot do
subject { described_class.new(params) }

pending 'TODO'
describe '#initialize' do
let(:params) do
{
id: id,
path_thumbnail: path_thumbnail,
path_full: path_full
}
end

context 'when the params are present' do
let(:id) { 0 }
let(:path_thumbnail) { 'https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/1174180/ss_66b553f4c209476d3e4ce25fa4714002cc914c4f.600x338.jpg?t=1714055653' }
let(:path_full) { 'https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/1174180/ss_66b553f4c209476d3e4ce25fa4714002cc914c4f.1920x1080.jpg?t=1714055653' }

it { is_expected.to have_attributes(**params) }
end

context 'when the params are missing' do
let(:params) { {} }

it 'raises a Dry::Struct::Error' do
expect { subject }.to raise_error(Dry::Struct::Error)
end
end
end
end

0 comments on commit fb7e954

Please sign in to comment.