Sha256: 67040f38719186358f4bdac79472b21767692d72ef693b4c5be02391e81a7fee

Contents?: true

Size: 678 Bytes

Versions: 2

Compression:

Stored size: 678 Bytes

Contents

require 'spec_helper'

describe VoightKampff::Test do
  let(:user_agent_string) { nil }
  subject { VoightKampff::Test.new(user_agent_string) }

  HUMANS.each do |name, ua_string|
    context "when user agent is #{name}" do
      let(:user_agent_string) { ua_string }

      it 'is not a replicant' do
        expect(subject.human?).to be true
        expect(subject.bot?).to be false
      end
    end
  end

  REPLICANTS.each do |name, ua_string|
    context "when user agent is #{name}" do
      let(:user_agent_string) { ua_string }

      it 'is a replicant' do
        expect(subject.bot?).to be true
        expect(subject.human?).to be false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voight_kampff-1.0.1 spec/lib/voight_kampff/test_spec.rb
voight_kampff-1.0.0 spec/lib/voight_kampff/test_spec.rb