<commit_before><commit_msg>Add a basic test for UserAgent<commit_after>require "spec_helper"

class UserAgentTest
  attr_accessor :user_agent
  include UserAgent

  def initialize(user_agent)
    @user_agent = user_agent
  end
end

describe UserAgent do
  context "Mobile Safari / iOS" do
    let(:u) { UserAgentTest.new("Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Mobile/11D257") }
    it { expect(u.ua_family).to eq "Mobile Safari" }
    it { expect(u.ua_version).to eq "7.1.2" }
    it { expect(u.os_family).to eq "iOS" }
    it { expect(u.os_version).to eq "7.1.2" }
  end
end
{'fraction_non_alphanumeric': 0.1167192429022082, 'fraction_numerical': 0.03470031545741325, 'mean_word_length': 3.774436090225564, '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': '6931037', 'n_tokens_mistral': 249, 'n_tokens_neox': 234, 'n_words': 62}