<commit_before># encoding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe 'UserAgentHelper' do
  describe 'devices name' do
    # DEVICES
    # :c => 'Computer'
    # :t => 'Tablet'
    # :m => 'Mobile'
    # :oth => 'Other'

    it 'should return "Computer" to key :c' do
      UserAgentHelper.device_name(:c).should  == 'Computer'
      UserAgentHelper.device_name('c').should == 'Computer'
    end

    it 'should return "Tablet" to key :t' do
      UserAgentHelper.device_name(:t).should  == 'Tablet'
      UserAgentHelper.device_name('t').should == 'Tablet'
    end

    it 'should return "Mobile" to key :m' do
      UserAgentHelper.device_name(:m).should  == 'Mobile'
      UserAgentHelper.device_name('m').should == 'Mobile'
    end

    it 'should return "Other" to key :oth' do
      UserAgentHelper.device_name(:oth).should  == 'Other'
      UserAgentHelper.device_name('oth').should == 'Other'
    end

    it 'should return "Other" to any other key' do
      UserAgentHelper.device_name(:wrong).should  == 'Other'
      UserAgentHelper.device_name('other thing').should  == 'Other'
      UserAgentHelper.device_name(nil).should  == 'Other'
    end

    # it 'should raise exeception if there is no param'
      # UserAgentHelper.device_name.should == nil
  end
end<commit_msg>should raise exeception if there is no param<commit_after># encoding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe 'UserAgentHelper' do
  describe 'devices name' do
    # DEVICES
    # :c => 'Computer'
    # :t => 'Tablet'
    # :m => 'Mobile'
    # :oth => 'Other'

    it 'should return "Computer" to key :c' do
      UserAgentHelper.device_name(:c).should  == 'Computer'
      UserAgentHelper.device_name('c').should == 'Computer'
    end

    it 'should return "Tablet" to key :t' do
      UserAgentHelper.device_name(:t).should  == 'Tablet'
      UserAgentHelper.device_name('t').should == 'Tablet'
    end

    it 'should return "Mobile" to key :m' do
      UserAgentHelper.device_name(:m).should  == 'Mobile'
      UserAgentHelper.device_name('m').should == 'Mobile'
    end

    it 'should return "Other" to key :oth' do
      UserAgentHelper.device_name(:oth).should  == 'Other'
      UserAgentHelper.device_name('oth').should == 'Other'
    end

    it 'should return "Other" to any other key' do
      UserAgentHelper.device_name(:wrong).should  == 'Other'
      UserAgentHelper.device_name('other thing').should  == 'Other'
      UserAgentHelper.device_name(nil).should  == 'Other'
    end

    it 'should raise exeception if there is no param' do
      lambda {
        UserAgentHelper.device_name

      }.should.raise Exception
    end  
  end
end
{'fraction_non_alphanumeric': 0.13183988248255601, 'fraction_numerical': 0.0007344840249724568, 'mean_word_length': 3.190769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '100511', 'n_tokens_mistral': 880, 'n_tokens_neox': 851, 'n_words': 218}