Sha256: e4a5a9a3d238ba84f99692caf31b3f5f2a152bc6a717ceebf0e9d2d6fc68f38e

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'
require 'rspec/webservice_matchers/be_fast'
include RSpec::WebserviceMatchers

describe BeFast do
  describe BeFast::TestResult do
    it 'requires :success' do
      expect {
        BeFast::TestResult.new {}
      }.to raise_error(ArgumentError, /success/i)
    end

    it 'requires :score' do
      expect {
        BeFast::TestResult.new { |r| r.success = true }
      }.to raise_error(ArgumentError, /score/i)
    end
  end

  describe '#test' do
    it 'handles a fast site' do
      result = BeFast.test url: 'http://nonstop.qa'
      expect( result.success? ).to be true
      expect( result.score    ).to be >= 85
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-webservice_matchers-4.9.0 spec/rspec/webservice_matchers/be_fast_spec.rb