rspeckled 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1e92b9ebb7465445ccdbc782af1c83f854e15e3f34e50d78f884cb857da4cbf
4
- data.tar.gz: 99e454f9fdcf1257dd657bd4e9cec19626cf1b8872663db53d93408898fdbf2f
3
+ metadata.gz: f2242b4977c2138c909d8092427a5cd4c5d156555f33d27cbea35ac1a0c5d66b
4
+ data.tar.gz: bab6b43c24e59de2df055c0591860f6d225a71d83711b306ae25bcf64ca7407a
5
5
  SHA512:
6
- metadata.gz: c5cba416580660f9791502e80606e99b1fab971827906981703f14a8d01431d99baa6608507c1a5b62ce2330f8d8f46fd6e8d4cb50f029e3ef8edfb03079fc51
7
- data.tar.gz: d13a7c697bdd2bd22118ecda0c2bc17dc6b18a727dad26ac5d23c0b0fc6ae355a7665a59bac81aa004b8b12320e0e2b46137abfd283371bad366c51d4e12cf34
6
+ metadata.gz: c923ead3e522635a882f5da44de06f7cf4f90ecfccab83599a85b56075af0867164bd7271909c4b2418ba9e1559841b974aa0c07ffb8fd4cfc017ff881e91a62
7
+ data.tar.gz: d45aef40ab984bc8d0d596095197958511a50594038c460e309c19706e3227b58cf31eb6124e342e8b3e9f6477a01236a75f5a1ce930ffafb6172e04f148bc5a
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -2,6 +2,24 @@
2
2
 
3
3
  require 'pp'
4
4
 
5
+ ################################################################################
6
+ # Test Gem Requires
7
+ #
8
+ # These are gems which, if they exist, we generally want to load. Ideally we'd
9
+ # be able to do this only if there were tests with the proper metadata
10
+ # specifying that we want to use these gems, however due to load order, they
11
+ # must be required here.
12
+ #
13
+ # Below, we throw exceptions for each gem if the user requests that a test use
14
+ # these gems, but the load failed (due to it not being in the gemspec/Gemfile).
15
+ #
16
+ # rubocop:disable Layout/EmptyLinesAroundExceptionHandlingKeywords
17
+ begin; require 'email_spec'; rescue LoadError; end
18
+ begin; require 'timecop'; rescue LoadError; end
19
+ begin; require 'webmock'; rescue LoadError; end
20
+ begin; require 'vcr'; rescue LoadError; end
21
+
22
+ # rubocop:enable Layout/EmptyLinesAroundExceptionHandlingKeywords
5
23
  ################################################################################
6
24
  # Configuration
7
25
  #
@@ -28,6 +46,7 @@ require 'rspeckled/plugins/configuration/selenium_webdriver' if defined?(::Sele
28
46
  require 'rspeckled/plugins/configuration/shoulda' if defined?(::Shoulda::Matchers)
29
47
  require 'rspeckled/plugins/configuration/sidekiq' if defined?(::Sidekiq)
30
48
  require 'rspeckled/plugins/configuration/test_after_commit' if defined?(::TestAfterCommit)
49
+ require 'rspeckled/plugins/configuration/vcr' if defined?(::VCR)
31
50
  require 'rspeckled/plugins/configuration/warden' if defined?(::Warden)
32
51
  require 'rspeckled/plugins/configuration/webmock' if defined?(::WebMock)
33
52
  require 'rspeckled/plugins/configuration/wisper' if defined?(::Wisper)
@@ -91,28 +110,34 @@ require 'rspeckled/plugins/extensions/omniauth' if defined?(::Omni
91
110
  # Setup for APIs by Always Allowing 'id' and Fail Fast By Raising on Unpermitted Parameters
92
111
  require 'rspeckled/plugins/extensions/strong_parameters' if defined?(::ActionController::Parameters)
93
112
 
113
+ # Register Matchers Which Ignore Trailing UUID/GUIDs in URLs
114
+ require 'rspeckled/plugins/extensions/vcr' if defined?(::VCR)
115
+
94
116
  ################################################################################
95
117
  # Automatic Gem Requirements
96
118
  #
97
119
  RSpec.configure do |config|
98
120
  config.when_first_matching_example_defined(:email) do
99
- require 'email_spec'
121
+ unless defined?(::EmailSpec)
122
+ fail LoadError, "Add 'email_spec' to your gemspec for Gemfile to use the :email metadata"
123
+ end
100
124
  end
101
125
 
102
126
  config.when_first_matching_example_defined(:time_mock) do
103
- require 'timecop'
104
- end
105
-
106
- config.when_first_matching_example_defined(:webmock) do
107
- require 'webmock'
127
+ unless defined?(::Timecop)
128
+ fail LoadError, "Add 'timecop' to your gemspec for Gemfile to use the :time_mock metadata"
129
+ end
108
130
  end
109
131
 
110
132
  config.when_first_matching_example_defined(:vcr) do
111
- require 'vcr'
112
-
113
- require 'rspeckled/plugins/configuration/vcr'
133
+ unless defined?(::VCR)
134
+ fail LoadError, "Add 'vcr' to your gemspec for Gemfile to use the :vcr metadata"
135
+ end
136
+ end
114
137
 
115
- # Register Matchers Which Ignore Trailing UUID/GUIDs in URLs
116
- require 'rspeckled/plugins/extensions/vcr'
138
+ config.when_first_matching_example_defined(:webmock) do
139
+ unless defined?(::WebMock)
140
+ fail LoadError, "Add 'webmock' to your gemspec for Gemfile to use the :webmock metadata"
141
+ end
117
142
  end
118
143
  end
@@ -22,5 +22,10 @@ end
22
22
  config.cassette_library_dir = ::File.expand_path('./tmp/vcr_cassettes')
23
23
  config.allow_http_connections_when_no_cassette = true
24
24
 
25
+ config.default_cassette_options = {
26
+ :record => :once,
27
+ :re_record_interval => 2_592_000,
28
+ }
29
+
25
30
  config.configure_rspec_metadata!
26
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rspeckled
4
- VERSION = '1.1.2'
4
+ VERSION = '1.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspeckled
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - thegranddesign
metadata.gz.sig CHANGED
Binary file