rspec-webservice_matchers 4.10.0 → 4.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
- # Specs for all of the PageSpeed code and matchers.
3
-
4
- require 'spec_helper'
5
- require 'rspec/webservice_matchers'
6
- require 'web_test/util'
7
-
8
-
9
- SAMPLE_JSON_RESPONSE = 'spec/fixtures/pagespeed.json'
10
-
11
- describe RSpec::WebserviceMatchers::BeFast do
12
- describe '#be_fast' do
13
- it 'performs a Google PageSpeed Insights API query on a fast site' do
14
- expect('nonstop.qa').to be_fast
15
- end
16
-
17
- it 'raises a friendly error if the api key has not been set' do
18
- # Remove the key
19
- key = ENV['WEBSERVICE_MATCHER_INSIGHTS_KEY']
20
- ENV['WEBSERVICE_MATCHER_INSIGHTS_KEY'] = nil
21
-
22
- expect {
23
- expect('nonstop.qa').not_to be_fast
24
- }.to raise_error(RuntimeError, /API key/)
25
-
26
- # Replace the key
27
- ENV['WEBSERVICE_MATCHER_INSIGHTS_KEY'] = key
28
- end
29
- end
30
- end