<commit_before>require_relative 'spec_helper'

describe "Changes to ActionController" do

  let(:controller) { InstanceMethodDummy.new }

  [
    ["xxx",  false],
    ["IPad", true],
    ["Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)", true]
  ].each do |example|

    describe "is_tablet_device?" do

      it "should return the expected result" do
        controller.user_agent = example[0]
        controller.send(:is_tablet_device?).must_equal example[1]
      end

    end

  end

end

class InstanceMethodDummy

  include ActionController::MobileFu::InstanceMethods

  attr_accessor :user_agent

  def request
    unless @request
      @request = Object.new
      @request.stubs(:user_agent).returns user_agent
    end
    @request
  end

end
<commit_msg>Can call the method directly.<commit_after>require_relative 'spec_helper'

describe "Changes to ActionController" do

  let(:controller) { InstanceMethodDummy.new }

  [
    ["xxx",  false],
    ["IPad", true],
    ["Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0; Touch)", true]
  ].each do |example|

    describe "is_tablet_device?" do

      it "should return the expected result" do
        controller.user_agent = example[0]
        controller.is_tablet_device?.must_equal example[1]
      end

    end

  end

end

class InstanceMethodDummy

  include ActionController::MobileFu::InstanceMethods

  attr_accessor :user_agent

  def request
    unless @request
      @request = Object.new
      @request.stubs(:user_agent).returns user_agent
    end
    @request
  end

end

{'fraction_non_alphanumeric': 0.10031347962382445, 'fraction_numerical': 0.013793103448275862, 'mean_word_length': 3.267379679144385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7183981', 'n_tokens_mistral': 528, 'n_tokens_neox': 502, 'n_words': 130}