File: tablet_spec.rb

package info (click to toggle)
ruby-mobile-fu 1.4.0%2Bgithub-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 152 kB
  • sloc: ruby: 206; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require_relative '../spec_helper.rb'

describe MobileFu::Tablet do

  describe "is a tablet device?" do

    ['Ipad', 
     'ipad', 
     'IPAD',
     'Mozilla/5.0 (Linux; Android 4.4; SM-T700 Build/KOT49H)',
    ].each do |user_agent|

      describe "examples that are a tablet" do

        it "should return true for #{user_agent}" do

          MobileFu::Tablet.is_a_tablet_device?(user_agent).must_equal true

        end

      end

    end

    ['iPhone', nil, 'MSIE'].each do |user_agent|

      describe "examples that are a tablet" do

        it "should return false for #{user_agent}" do

          MobileFu::Tablet.is_a_tablet_device?(user_agent).must_equal false

        end

      end

    end

  end

end