diff --git a/calabash-cucumber/lib/calabash-cucumber/device.rb b/calabash-cucumber/lib/calabash-cucumber/device.rb index 40ce450ea..9bdf961a7 100644 --- a/calabash-cucumber/lib/calabash-cucumber/device.rb +++ b/calabash-cucumber/lib/calabash-cucumber/device.rb @@ -136,7 +136,7 @@ class Device # @return [Hash] screen dimensions, scale and down/up sampling fraction. attr_reader :screen_dimensions - # @deprecated 0.13.0 no replacement + # @deprecated 0.13.1 no replacement # Indicates whether or not this device has a 4in screen. # @attribute [r] iphone_4in # @return [Boolean] `true` if this device has a 4in screen. @@ -323,6 +323,15 @@ def iphone_5? _deprecated('0.9.168', "use 'iphone_4in?' instead", :warn) iphone_4in? end + + # @deprecated 0.13.1 - Call `iphone_4in?` instead. + # @see #iphone_4in? + # @note Deprecated after introducing new `form_factor` behavior. + # @return [Boolean] true if this device is an iPhone 5 or 5s + def iphone_4in + _deprecated('0.13.1', "use 'iphone_4in?' instead", :warn) + @iphone_4in + end end end end diff --git a/calabash-cucumber/spec/lib/deprecated_spec.rb b/calabash-cucumber/spec/lib/deprecated_spec.rb index 0a8806018..772a1312b 100644 --- a/calabash-cucumber/spec/lib/deprecated_spec.rb +++ b/calabash-cucumber/spec/lib/deprecated_spec.rb @@ -21,5 +21,17 @@ expect(val).to be == nil end end + + it 'Device iphone_4in attribute' do + simulator_data = Resources.shared.server_version :simulator + endpoint = 'http://localhost:37265' + device = Calabash::Cucumber::Device.new(endpoint, simulator_data) + out = capture_stderr do + device.iphone_4in + end + expect(out.string).not_to be == nil + expect(out.string).not_to be == '' + expect(out.string =~ /WARN: deprecated '0.13.1' - 'use 'iphone_4in\?' instead/).not_to be == nil + end end end