lib/scan/detect_values.rb in scan-0.1.0 vs lib/scan/detect_values.rb in scan-0.1.1
- old
+ new
@@ -24,11 +24,15 @@
def self.default_device
config = Scan.config
if config[:device] # make sure it actually exists
- return if FastlaneCore::Simulator.all.find { |d| d.name == config[:device].strip }
- Helper.log.error "Couldn't find simulator '#{config[:device]}' - falling back to default simulator".red
+ found = FastlaneCore::Simulator.all.find { |d| d.name == config[:device].to_s.strip }
+ if found
+ config[:device] = found
+ else
+ Helper.log.error "Couldn't find simulator '#{config[:device]}' - falling back to default simulator".red
+ end
end
# An iPhone 5s is reasonable small and useful for tests
found = FastlaneCore::Simulator.all.find { |d| d.name == "iPhone 5s" }
found ||= FastlaneCore::Simulator.all.first # anything is better than nothing