Sha256: e705f6ea58a42f18f62c0dcf1d67ba4073fb241b04b7adbd9f7f582b3ac77ba7

Contents?: true

Size: 459 Bytes

Versions: 6

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true
require 'rspec/matchers'
require 'web_test/be_fast'

module RSpec
  module WebserviceMatchers
    module BeFast
      RSpec::Matchers.define :be_fast do
        score = nil

        match do |url|
          result = WebTest::BeFast.test(url: url)
          score = result.score
          result.success?
        end

        failure_message do
          "PageSpeed score is #{score}/100."
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-webservice_matchers-4.13 lib/rspec/webservice_matchers/be_fast.rb
rspec-webservice_matchers-4.12.2 lib/rspec/webservice_matchers/be_fast.rb
rspec-webservice_matchers-4.12.1 lib/rspec/webservice_matchers/be_fast.rb
rspec-webservice_matchers-4.12.0 lib/rspec/webservice_matchers/be_fast.rb
rspec-webservice_matchers-4.11.0 lib/rspec/webservice_matchers/be_fast.rb
rspec-webservice_matchers-4.10.0 lib/rspec/webservice_matchers/be_fast.rb