Sha256: 8268778ebe6e841795c5b4e5ababe4b442654d40d8fd1f164635a479e5b0a5d2
Contents?: true
Size: 918 Bytes
Versions: 24
Compression:
Stored size: 918 Bytes
Contents
# frozen_string_literal: true require "test_helper" require "browser/aliases" class AliasesTest < Minitest::Test class BrowserMock include Browser::Aliases def platform @platform ||= Object.new end def device @device ||= Object.new end end Browser::Aliases::PLATFORM_ALIASES.each do |method_name| test "adds #{method_name.inspect} as a platform alias" do browser = BrowserMock.new browser.platform.define_singleton_method(method_name) do :called end assert_equal :called, browser.public_send(method_name) end end Browser::Aliases::DEVICE_ALIASES.each do |method_name| test "adds #{method_name.inspect} as a device alias" do browser = BrowserMock.new browser.device.define_singleton_method(method_name) do :called end assert_equal :called, browser.public_send(method_name) end end end
Version data entries
24 entries across 24 versions & 1 rubygems