Skip to content

Commit

Permalink
Reduce amount of deprecation output, use UI module instead of warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lacostej committed Nov 22, 2023
1 parent 3806885 commit f1fc587
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spaceship/lib/spaceship/tunes/device_type.rb
Expand Up @@ -5,7 +5,7 @@ module Tunes
# identifiers of devices that App Store Connect accepts screenshots for
class DeviceType
def self.types
warn("Spaceship::Tunes::DeviceType has been deprecated, use Spaceship::Tunes::DisplayFamily instead. (https://github.com/fastlane/fastlane/pull/14574).")
UI.important("Spaceship::Tunes::DeviceType has been deprecated, use Spaceship::Tunes::DisplayFamily instead. (https://github.com/fastlane/fastlane/pull/14574).")
return DisplayFamily.all.map(&:name)
end

Expand Down
7 changes: 6 additions & 1 deletion spaceship/spec/tunes/device_type_spec.rb
@@ -1,5 +1,9 @@
describe Spaceship::Tunes::DeviceType do
describe "type identifiers" do
before(:each) do
expect(FastlaneCore::UI).to receive(:important).with(/Spaceship::Tunes::DeviceType has been deprecated./)
end

it "should be checkable using singleton functions" do
expect(Spaceship::Tunes::DeviceType.exists?("iphone6")).to be_truthy
end
Expand Down Expand Up @@ -38,8 +42,9 @@
'desktop'
]

types = Spaceship::Tunes::DeviceType.types
old_types.each do |identifier|
expect(Spaceship::Tunes::DeviceType.types).to include(identifier)
expect(types).to include(identifier)
end
end
end
Expand Down

0 comments on commit f1fc587

Please sign in to comment.