rspeckled 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rspeckled/{plugins/rails/engine.rb → patches/rails/namespaced_engine_controller_route_fix.rb} +2 -0
- data/lib/rspeckled/patches.rb +10 -0
- data/lib/rspeckled/plugins/configuration/bullet.rb +5 -0
- data/lib/rspeckled/plugins/configuration/capybara.rb +22 -0
- data/lib/rspeckled/plugins/configuration/capybara_screenshot.rb +17 -0
- data/lib/rspeckled/plugins/configuration/carrier_wave.rb +13 -0
- data/lib/rspeckled/plugins/configuration/database_cleaner.rb +7 -0
- data/lib/rspeckled/plugins/configuration/devise.rb +18 -0
- data/lib/rspeckled/plugins/{dox.rb → configuration/dox.rb} +1 -8
- data/lib/rspeckled/plugins/configuration/elasticsearch.rb +3 -0
- data/lib/rspeckled/plugins/configuration/email_spec.rb +7 -0
- data/lib/rspeckled/plugins/configuration/factory_bot.rb +13 -0
- data/lib/rspeckled/plugins/{fakeredis.rb → configuration/fakeredis.rb} +0 -0
- data/lib/rspeckled/plugins/{mongoid.rb → configuration/mongoid.rb} +1 -1
- data/lib/rspeckled/plugins/configuration/omniauth.rb +5 -0
- data/lib/rspeckled/plugins/{recaptcha.rb → configuration/recaptcha.rb} +1 -1
- data/lib/rspeckled/plugins/configuration/selenium_webdriver.rb +3 -0
- data/lib/rspeckled/plugins/configuration/shoulda.rb +36 -0
- data/lib/rspeckled/plugins/{test_after_commit.rb → configuration/sidekiq.rb} +1 -1
- data/lib/rspeckled/plugins/{simple_cov.rb → configuration/simple_cov.rb} +2 -2
- data/lib/rspeckled/plugins/configuration/test_after_commit.rb +3 -0
- data/lib/rspeckled/plugins/configuration/vcr.rb +26 -0
- data/lib/rspeckled/plugins/configuration/warden.rb +7 -0
- data/lib/rspeckled/plugins/configuration/webmock.rb +3 -0
- data/lib/rspeckled/plugins/{wisper.rb → configuration/wisper.rb} +1 -1
- data/lib/rspeckled/plugins/{awesome_print.rb → extensions/awesome_print.rb} +6 -6
- data/lib/rspeckled/plugins/extensions/capybara.rb +30 -0
- data/lib/rspeckled/{factories → plugins/extensions/factory_bot}/sequences.rb +4 -4
- data/lib/rspeckled/plugins/{faraday.rb → extensions/faraday/middleware/curl_logger.rb} +1 -3
- data/lib/rspeckled/plugins/extensions/faraday.rb +5 -0
- data/lib/rspeckled/{mock_authentications/omniauth → plugins/extensions/omniauth/mock_authentications}/ebay.rb +3 -1
- data/lib/rspeckled/{mock_authentications/omniauth → plugins/extensions/omniauth/mock_authentications}/facebook.rb +3 -1
- data/lib/rspeckled/{mock_authentications/omniauth → plugins/extensions/omniauth/mock_authentications}/twitter.rb +3 -1
- data/lib/rspeckled/plugins/extensions/omniauth.rb +12 -0
- data/lib/rspeckled/{rails → plugins/extensions/rails}/railtie.rb +3 -1
- data/lib/rspeckled/plugins/{garbage_collection.rb → extensions/ruby/deferred_garbage_collection.rb} +7 -15
- data/lib/rspeckled/{selenium → plugins/extensions/selenium}/drivers/chrome.rb +1 -1
- data/lib/rspeckled/{selenium → plugins/extensions/selenium}/drivers/firefox.rb +1 -1
- data/lib/rspeckled/plugins/extensions/strong_parameters.rb +13 -0
- data/lib/rspeckled/{vcr_matchers → plugins/extensions/vcr/matchers}/uri_without_trailing_id.rb +4 -12
- data/lib/rspeckled/plugins/extensions/vcr.rb +13 -0
- data/lib/rspeckled/plugins/hooks/action_mailer.rb +15 -0
- data/lib/rspeckled/plugins/{authentication.rb → hooks/authentication.rb} +12 -4
- data/lib/rspeckled/plugins/hooks/bullet.rb +22 -0
- data/lib/rspeckled/plugins/hooks/capybara.rb +44 -0
- data/lib/rspeckled/plugins/{carrier_wave.rb → hooks/carrier_wave.rb} +4 -12
- data/lib/rspeckled/plugins/hooks/database_cleaner.rb +37 -0
- data/lib/rspeckled/plugins/hooks/devise.rb +11 -0
- data/lib/rspeckled/plugins/hooks/dox.rb +8 -0
- data/lib/rspeckled/plugins/hooks/elasticsearch.rb +37 -0
- data/lib/rspeckled/plugins/hooks/factory_bot.rb +21 -0
- data/lib/rspeckled/plugins/{foreign_keys.rb → hooks/foreign_keys.rb} +10 -6
- data/lib/rspeckled/plugins/hooks/garbage_collection.rb +21 -0
- data/lib/rspeckled/plugins/hooks/referehencible.rb +18 -0
- data/lib/rspeckled/plugins/{request.rb → hooks/request.rb} +4 -0
- data/lib/rspeckled/plugins/hooks/rspec_mocks.rb +20 -0
- data/lib/rspeckled/plugins/hooks/selenium_webdriver.rb +15 -0
- data/lib/rspeckled/plugins/hooks/sidekiq.rb +49 -0
- data/lib/rspeckled/plugins/{singleton.rb → hooks/singletons.rb} +6 -4
- data/lib/rspeckled/plugins/hooks/stripe.rb +30 -0
- data/lib/rspeckled/plugins/{timecop.rb → hooks/timecop.rb} +11 -9
- data/lib/rspeckled/plugins/hooks/vcr.rb +15 -0
- data/lib/rspeckled/plugins/hooks/warden.rb +13 -0
- data/lib/rspeckled/plugins/hooks/webmock.rb +21 -0
- data/lib/rspeckled/plugins.rb +92 -73
- data/lib/rspeckled/spec_helpers/rspeckled.rb +2 -2
- data/lib/rspeckled/support.rb +22 -12
- data/lib/rspeckled/tasks/documentation.rake +2 -2
- data/lib/rspeckled/version.rb +1 -1
- data/lib/rspeckled.rb +1 -1
- data.tar.gz.sig +4 -3
- metadata +65 -44
- metadata.gz.sig +0 -0
- data/lib/rspeckled/mock_authentications/omniauth.rb +0 -3
- data/lib/rspeckled/plugins/bullet.rb +0 -18
- data/lib/rspeckled/plugins/capybara.rb +0 -127
- data/lib/rspeckled/plugins/database_cleaner.rb +0 -35
- data/lib/rspeckled/plugins/devise.rb +0 -24
- data/lib/rspeckled/plugins/elasticsearch.rb +0 -27
- data/lib/rspeckled/plugins/email.rb +0 -25
- data/lib/rspeckled/plugins/factory_bot.rb +0 -23
- data/lib/rspeckled/plugins/mocks.rb +0 -16
- data/lib/rspeckled/plugins/omniauth.rb +0 -39
- data/lib/rspeckled/plugins/rails/strong_parameters.rb +0 -13
- data/lib/rspeckled/plugins/referehencible.rb +0 -14
- data/lib/rspeckled/plugins/shoulda.rb +0 -36
- data/lib/rspeckled/plugins/sidekiq.rb +0 -38
- data/lib/rspeckled/plugins/stripe.rb +0 -26
- data/lib/rspeckled/plugins/vcr.rb +0 -38
- data/lib/rspeckled/plugins/webmock.rb +0 -19
data/lib/rspeckled/plugins.rb
CHANGED
@@ -2,76 +2,95 @@
|
|
2
2
|
|
3
3
|
require 'pp'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
require 'rspeckled/plugins/
|
15
|
-
require 'rspeckled/plugins/
|
16
|
-
|
17
|
-
require 'rspeckled/plugins/
|
18
|
-
require 'rspeckled/plugins/
|
19
|
-
require 'rspeckled/plugins/
|
20
|
-
require 'rspeckled/plugins/
|
21
|
-
require 'rspeckled/plugins/
|
22
|
-
require 'rspeckled/plugins/
|
23
|
-
require 'rspeckled/plugins/
|
24
|
-
require 'rspeckled/plugins/
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
5
|
+
################################################################################
|
6
|
+
# Configuration
|
7
|
+
#
|
8
|
+
# These are the standard requires and configuration generally listed in the
|
9
|
+
# gem's README.
|
10
|
+
#
|
11
|
+
# These files do *not* load the ACTUAL gem, but WILL load any RSpec files that
|
12
|
+
# the README says need to be required (but only if necessary).
|
13
|
+
#
|
14
|
+
require 'rspeckled/plugins/configuration/bullet' if defined?(::Bullet)
|
15
|
+
require 'rspeckled/plugins/configuration/capybara' if defined?(::Capybara)
|
16
|
+
require 'rspeckled/plugins/configuration/capybara_screenshot' if defined?(::Capybara::Screenshot)
|
17
|
+
require 'rspeckled/plugins/configuration/carrier_wave' if defined?(::CarrierWave)
|
18
|
+
require 'rspeckled/plugins/configuration/database_cleaner' if defined?(::DatabaseCleaner)
|
19
|
+
require 'rspeckled/plugins/configuration/devise' if defined?(::Devise)
|
20
|
+
require 'rspeckled/plugins/configuration/elasticsearch' if defined?(::Elasticsearch)
|
21
|
+
require 'rspeckled/plugins/configuration/email_spec' if defined?(::EmailSpec)
|
22
|
+
require 'rspeckled/plugins/configuration/factory_bot' if defined?(::FactoryBot)
|
23
|
+
require 'rspeckled/plugins/configuration/fakeredis' if defined?(::FakeRedis)
|
24
|
+
require 'rspeckled/plugins/configuration/mongoid' if defined?(::Mongoid)
|
25
|
+
require 'rspeckled/plugins/configuration/omniauth' if defined?(::OmniAuth)
|
26
|
+
require 'rspeckled/plugins/configuration/recaptcha' if defined?(::Recaptcha)
|
27
|
+
require 'rspeckled/plugins/configuration/selenium_webdriver' if defined?(::Selenium::WebDriver)
|
28
|
+
require 'rspeckled/plugins/configuration/shoulda' if defined?(::Shoulda::Matchers)
|
29
|
+
require 'rspeckled/plugins/configuration/sidekiq' if defined?(::Sidekiq)
|
30
|
+
require 'rspeckled/plugins/configuration/test_after_commit' if defined?(::TestAfterCommit)
|
31
|
+
require 'rspeckled/plugins/configuration/vcr' if defined?(::VCR)
|
32
|
+
require 'rspeckled/plugins/configuration/warden' if defined?(::Warden)
|
33
|
+
require 'rspeckled/plugins/configuration/webmock' if defined?(::WebMock)
|
34
|
+
require 'rspeckled/plugins/configuration/wisper' if defined?(::Wisper)
|
35
|
+
|
36
|
+
################################################################################
|
37
|
+
# Hooks
|
38
|
+
#
|
39
|
+
# These are the hooks around specs that are either required or are best
|
40
|
+
# practices for a given gem based on the gem's README.
|
41
|
+
#
|
42
|
+
# Some of these would happen on every spec. In those cases we just check to see
|
43
|
+
# if the constant exists. In other cases we only want it to happen if the test
|
44
|
+
# has specific metadata. In those cases we load it regardless because we want
|
45
|
+
# the user to get an error if the required libraries are not loaded.
|
46
|
+
#
|
47
|
+
# THE ORDER OF SOME OF THESE HOOKS MATTERS!
|
48
|
+
#
|
49
|
+
require 'rspeckled/plugins/hooks/garbage_collection'
|
50
|
+
require 'rspeckled/plugins/hooks/request'
|
51
|
+
require 'rspeckled/plugins/hooks/timecop'
|
52
|
+
|
53
|
+
require 'rspeckled/plugins/hooks/action_mailer' if defined?(::ActionMailer)
|
54
|
+
require 'rspeckled/plugins/hooks/authentication'
|
55
|
+
require 'rspeckled/plugins/hooks/bullet' if defined?(::Bullet)
|
56
|
+
require 'rspeckled/plugins/hooks/capybara'
|
57
|
+
require 'rspeckled/plugins/hooks/carrier_wave'
|
58
|
+
require 'rspeckled/plugins/hooks/database_cleaner' if defined?(::DatabaseCleaner)
|
59
|
+
require 'rspeckled/plugins/hooks/devise' if defined?(::Devise)
|
60
|
+
require 'rspeckled/plugins/hooks/dox'
|
61
|
+
require 'rspeckled/plugins/hooks/elasticsearch'
|
62
|
+
require 'rspeckled/plugins/hooks/factory_bot' if defined?(::FactoryBot)
|
63
|
+
require 'rspeckled/plugins/hooks/foreign_keys'
|
64
|
+
require 'rspeckled/plugins/hooks/referehencible'
|
65
|
+
require 'rspeckled/plugins/hooks/rspec_mocks'
|
66
|
+
require 'rspeckled/plugins/hooks/selenium_webdriver'
|
67
|
+
require 'rspeckled/plugins/hooks/sidekiq'
|
68
|
+
require 'rspeckled/plugins/hooks/singletons'
|
69
|
+
require 'rspeckled/plugins/hooks/stripe'
|
70
|
+
require 'rspeckled/plugins/hooks/vcr'
|
71
|
+
require 'rspeckled/plugins/hooks/warden' if defined?(::Warden)
|
72
|
+
require 'rspeckled/plugins/hooks/webmock'
|
73
|
+
|
74
|
+
################################################################################
|
75
|
+
# Extensions
|
76
|
+
#
|
77
|
+
# These are the more opinionated bits that involve gems.
|
78
|
+
#
|
79
|
+
# Add 'sap' Kernel Method for Amazing puts Debugging
|
80
|
+
require 'rspeckled/plugins/extensions/awesome_print' if defined?(::AwesomePrint)
|
81
|
+
|
82
|
+
# Properly Configure Puma and Setup Headed/Headless Chrome/Firefix Adapters
|
83
|
+
require 'rspeckled/plugins/extensions/capybara' if defined?(::Capybara)
|
84
|
+
|
85
|
+
# Register a Faraday Middleware for Amazing Request/Response Logging
|
86
|
+
require 'rspeckled/plugins/extensions/faraday' if defined?(::Faraday::Response::Middleware) &&
|
87
|
+
defined?(::Faraday::Response)
|
88
|
+
|
89
|
+
# Registers Fixtures for Mocking OAuth Responses from Common Services (Facebook, Twitter, etc)
|
90
|
+
require 'rspeckled/plugins/extensions/omniauth' if defined?(::OmniAuth)
|
91
|
+
|
92
|
+
# Setup for APIs by Always Allowing 'id' and Fail Fast By Raising on Unpermitted Parameters
|
93
|
+
require 'rspeckled/plugins/extensions/strong_parameters' if defined?(::ActionController::Parameters)
|
94
|
+
|
95
|
+
# Register Matchers Which Ignore Trailing UUID/GUIDs in URLs
|
96
|
+
require 'rspeckled/plugins/extensions/vcr' if defined?(::VCR)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# These Plugins Must Be Loaded Before Anything Else
|
4
|
-
require 'rspeckled/plugins/simple_cov'
|
5
|
-
require 'rspeckled/plugins/dox'
|
4
|
+
require 'rspeckled/plugins/configuration/simple_cov'
|
5
|
+
require 'rspeckled/plugins/configuration/dox'
|
6
6
|
|
7
7
|
require 'rspeckled/reporting'
|
8
8
|
require 'rspeckled/support'
|
data/lib/rspeckled/support.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'logger'
|
4
|
+
|
3
5
|
###
|
4
6
|
# If DATABASE_URL is set, it means we're in production and running the tests
|
5
7
|
# would be very bad news.
|
@@ -7,6 +9,18 @@
|
|
7
9
|
abort('DATABASE_URL environment variable is set') if ENV['DATABASE_URL']
|
8
10
|
|
9
11
|
RSpec.configure do |config|
|
12
|
+
##############################################################################
|
13
|
+
# RSPECKLED CONFIGURATION
|
14
|
+
##############################################################################
|
15
|
+
|
16
|
+
default_logger = ::Logger.new($stdout)
|
17
|
+
default_logger.level = ENV.fetch('RSPECKLED_LOG_LEVEL', ::Logger::WARN).to_i
|
18
|
+
|
19
|
+
config.add_setting :rspeckled_logger, :default => default_logger
|
20
|
+
config.add_setting :rspeckled_disabled_plugin_configuration, :default => []
|
21
|
+
config.add_setting :rspeckled_disabled_plugin_hooks, :default => []
|
22
|
+
config.add_setting :rspeckled_disabled_plugin_extensions, :default => []
|
23
|
+
|
10
24
|
##############################################################################
|
11
25
|
# RSPEC 4 PREP
|
12
26
|
##############################################################################
|
@@ -17,19 +31,11 @@ RSpec.configure do |config|
|
|
17
31
|
# RAILS
|
18
32
|
##############################################################################
|
19
33
|
|
20
|
-
if defined?(RSpec::Rails)
|
21
|
-
require 'rspeckled/plugins/rails/engine'
|
22
|
-
|
34
|
+
if defined?(::RSpec::Rails)
|
23
35
|
config.infer_base_class_for_anonymous_controllers = true
|
24
36
|
config.use_transactional_fixtures = true
|
25
37
|
|
26
38
|
config.infer_spec_type_from_file_location! if config.respond_to?(:infer_spec_type_from_file_location!)
|
27
|
-
|
28
|
-
if Pathname.pwd.join('spec', 'dummy', 'config', 'environment.rb').exist?
|
29
|
-
require 'rspeckled/plugins/rails/engine'
|
30
|
-
|
31
|
-
config.include Rspeckled::NamespacedEngineControllerRouteFix, :type => :controller
|
32
|
-
end
|
33
39
|
end
|
34
40
|
|
35
41
|
##############################################################################
|
@@ -47,8 +53,8 @@ RSpec.configure do |config|
|
|
47
53
|
# INTERNATIONALIZATION
|
48
54
|
##############################################################################
|
49
55
|
|
50
|
-
if defined?
|
51
|
-
config.include ActionView::Helpers::TranslationHelper
|
56
|
+
if defined?(::ActionView::Helpers::TranslationHelper)
|
57
|
+
config.include ::ActionView::Helpers::TranslationHelper
|
52
58
|
end
|
53
59
|
|
54
60
|
##############################################################################
|
@@ -75,7 +81,7 @@ RSpec.configure do |config|
|
|
75
81
|
config.add_formatter 'Fuubar'
|
76
82
|
config.add_formatter 'documentation', 'tmp/rspec.txt'
|
77
83
|
|
78
|
-
if ENV['CIRCLE_TEST_REPORTS'] && defined?(RSpecJUnitFormatter)
|
84
|
+
if ENV['CIRCLE_TEST_REPORTS'] && defined?(::RSpecJUnitFormatter)
|
79
85
|
config.add_formatter 'RSpecJUnitFormatter',
|
80
86
|
"#{ENV['CIRCLE_TEST_REPORTS']}/rspec.xml"
|
81
87
|
end
|
@@ -131,5 +137,9 @@ RSpec.configure do |config|
|
|
131
137
|
config.expect_with :rspec do |c|
|
132
138
|
c.syntax = :expect
|
133
139
|
c.include_chain_clauses_in_custom_matcher_descriptions = true
|
140
|
+
|
141
|
+
if c.respond_to?(:max_formatted_output_length=)
|
142
|
+
c.max_formatted_output_length = 512
|
143
|
+
end
|
134
144
|
end
|
135
145
|
end
|
@@ -15,7 +15,7 @@ namespace :documentation do
|
|
15
15
|
t.rspec_opts = '--format="Dox::Formatter" --out="./docs/api/index.apib" --order="defined" --tag="dox"'
|
16
16
|
end
|
17
17
|
|
18
|
-
Rake::Task['api_docs'].invoke
|
18
|
+
::Rake::Task['api_docs'].invoke
|
19
19
|
end
|
20
20
|
|
21
21
|
task :json => :blueprint do
|
@@ -35,7 +35,7 @@ namespace :documentation do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
task :publish => :blueprint do
|
38
|
-
`apiary publish --path='./docs/api/apispec.apib' --api-name='#{Rails.application.name}'`
|
38
|
+
`apiary publish --path='./docs/api/apispec.apib' --api-name='#{::Rails.application.name}'`
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/rspeckled/version.rb
CHANGED
data/lib/rspeckled.rb
CHANGED
data.tar.gz.sig
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
K#�P|�'���/{��+���c��
|
2
|
+
�O���}r�-�
|
3
|
+
�-�M<wUk�z��f��N�y�*������Ow+��/��=����z�9�ob�~�m1�T�-
|
4
|
+
��ғ�),��B��l�:fO�����JI㊐~�|��~Y��Q��o���M�zxhX���Lm�3�s7���gϼ�w*��!���G�
|
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.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thegranddesign
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
eUgMp+qKjyM1NGj/222soSUpWqOE16L23vv8sWIbMIADdR8dephQ6jMovYylUmE5
|
36
36
|
KHp+JJQviSN0i4z8gVL2zloo+xZf791LiJH8Kcjpx43jhg0WdR4=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2018-
|
38
|
+
date: 2018-10-03 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rspec
|
@@ -104,60 +104,82 @@ files:
|
|
104
104
|
- LICENSE.txt
|
105
105
|
- README.md
|
106
106
|
- lib/rspeckled.rb
|
107
|
-
- lib/rspeckled/factories/sequences.rb
|
108
107
|
- lib/rspeckled/helpers.rb
|
109
108
|
- lib/rspeckled/helpers/factories.rb
|
110
109
|
- lib/rspeckled/helpers/filepaths.rb
|
111
110
|
- lib/rspeckled/helpers/null_objects.rb
|
112
111
|
- lib/rspeckled/helpers/patterns.rb
|
113
112
|
- lib/rspeckled/helpers/responses.rb
|
114
|
-
- lib/rspeckled/mock_authentications/omniauth.rb
|
115
|
-
- lib/rspeckled/mock_authentications/omniauth/ebay.rb
|
116
|
-
- lib/rspeckled/mock_authentications/omniauth/facebook.rb
|
117
|
-
- lib/rspeckled/mock_authentications/omniauth/twitter.rb
|
118
113
|
- lib/rspeckled/patches.rb
|
114
|
+
- lib/rspeckled/patches/rails/namespaced_engine_controller_route_fix.rb
|
119
115
|
- lib/rspeckled/plugins.rb
|
120
|
-
- lib/rspeckled/plugins/
|
121
|
-
- lib/rspeckled/plugins/
|
122
|
-
- lib/rspeckled/plugins/
|
123
|
-
- lib/rspeckled/plugins/
|
124
|
-
- lib/rspeckled/plugins/
|
125
|
-
- lib/rspeckled/plugins/
|
126
|
-
- lib/rspeckled/plugins/
|
127
|
-
- lib/rspeckled/plugins/
|
128
|
-
- lib/rspeckled/plugins/
|
129
|
-
- lib/rspeckled/plugins/
|
130
|
-
- lib/rspeckled/plugins/
|
131
|
-
- lib/rspeckled/plugins/
|
132
|
-
- lib/rspeckled/plugins/
|
133
|
-
- lib/rspeckled/plugins/
|
134
|
-
- lib/rspeckled/plugins/
|
135
|
-
- lib/rspeckled/plugins/
|
136
|
-
- lib/rspeckled/plugins/
|
137
|
-
- lib/rspeckled/plugins/
|
138
|
-
- lib/rspeckled/plugins/
|
139
|
-
- lib/rspeckled/plugins/
|
140
|
-
- lib/rspeckled/plugins/
|
141
|
-
- lib/rspeckled/plugins/
|
142
|
-
- lib/rspeckled/plugins/
|
143
|
-
- lib/rspeckled/plugins/
|
144
|
-
- lib/rspeckled/plugins/
|
145
|
-
- lib/rspeckled/plugins/
|
146
|
-
- lib/rspeckled/plugins/
|
147
|
-
- lib/rspeckled/plugins/
|
148
|
-
- lib/rspeckled/plugins/
|
149
|
-
- lib/rspeckled/plugins/
|
150
|
-
- lib/rspeckled/plugins/
|
151
|
-
- lib/rspeckled/plugins/
|
152
|
-
- lib/rspeckled/plugins/
|
153
|
-
- lib/rspeckled/
|
116
|
+
- lib/rspeckled/plugins/configuration/bullet.rb
|
117
|
+
- lib/rspeckled/plugins/configuration/capybara.rb
|
118
|
+
- lib/rspeckled/plugins/configuration/capybara_screenshot.rb
|
119
|
+
- lib/rspeckled/plugins/configuration/carrier_wave.rb
|
120
|
+
- lib/rspeckled/plugins/configuration/database_cleaner.rb
|
121
|
+
- lib/rspeckled/plugins/configuration/devise.rb
|
122
|
+
- lib/rspeckled/plugins/configuration/dox.rb
|
123
|
+
- lib/rspeckled/plugins/configuration/elasticsearch.rb
|
124
|
+
- lib/rspeckled/plugins/configuration/email_spec.rb
|
125
|
+
- lib/rspeckled/plugins/configuration/factory_bot.rb
|
126
|
+
- lib/rspeckled/plugins/configuration/fakeredis.rb
|
127
|
+
- lib/rspeckled/plugins/configuration/mongoid.rb
|
128
|
+
- lib/rspeckled/plugins/configuration/omniauth.rb
|
129
|
+
- lib/rspeckled/plugins/configuration/recaptcha.rb
|
130
|
+
- lib/rspeckled/plugins/configuration/selenium_webdriver.rb
|
131
|
+
- lib/rspeckled/plugins/configuration/shoulda.rb
|
132
|
+
- lib/rspeckled/plugins/configuration/sidekiq.rb
|
133
|
+
- lib/rspeckled/plugins/configuration/simple_cov.rb
|
134
|
+
- lib/rspeckled/plugins/configuration/test_after_commit.rb
|
135
|
+
- lib/rspeckled/plugins/configuration/vcr.rb
|
136
|
+
- lib/rspeckled/plugins/configuration/warden.rb
|
137
|
+
- lib/rspeckled/plugins/configuration/webmock.rb
|
138
|
+
- lib/rspeckled/plugins/configuration/wisper.rb
|
139
|
+
- lib/rspeckled/plugins/extensions/awesome_print.rb
|
140
|
+
- lib/rspeckled/plugins/extensions/capybara.rb
|
141
|
+
- lib/rspeckled/plugins/extensions/factory_bot/sequences.rb
|
142
|
+
- lib/rspeckled/plugins/extensions/faraday.rb
|
143
|
+
- lib/rspeckled/plugins/extensions/faraday/middleware/curl_logger.rb
|
144
|
+
- lib/rspeckled/plugins/extensions/omniauth.rb
|
145
|
+
- lib/rspeckled/plugins/extensions/omniauth/mock_authentications/ebay.rb
|
146
|
+
- lib/rspeckled/plugins/extensions/omniauth/mock_authentications/facebook.rb
|
147
|
+
- lib/rspeckled/plugins/extensions/omniauth/mock_authentications/twitter.rb
|
148
|
+
- lib/rspeckled/plugins/extensions/rails/railtie.rb
|
149
|
+
- lib/rspeckled/plugins/extensions/ruby/deferred_garbage_collection.rb
|
150
|
+
- lib/rspeckled/plugins/extensions/selenium/drivers/chrome.rb
|
151
|
+
- lib/rspeckled/plugins/extensions/selenium/drivers/firefox.rb
|
152
|
+
- lib/rspeckled/plugins/extensions/strong_parameters.rb
|
153
|
+
- lib/rspeckled/plugins/extensions/vcr.rb
|
154
|
+
- lib/rspeckled/plugins/extensions/vcr/matchers/uri_without_trailing_id.rb
|
155
|
+
- lib/rspeckled/plugins/hooks/action_mailer.rb
|
156
|
+
- lib/rspeckled/plugins/hooks/authentication.rb
|
157
|
+
- lib/rspeckled/plugins/hooks/bullet.rb
|
158
|
+
- lib/rspeckled/plugins/hooks/capybara.rb
|
159
|
+
- lib/rspeckled/plugins/hooks/carrier_wave.rb
|
160
|
+
- lib/rspeckled/plugins/hooks/database_cleaner.rb
|
161
|
+
- lib/rspeckled/plugins/hooks/devise.rb
|
162
|
+
- lib/rspeckled/plugins/hooks/dox.rb
|
163
|
+
- lib/rspeckled/plugins/hooks/elasticsearch.rb
|
164
|
+
- lib/rspeckled/plugins/hooks/factory_bot.rb
|
165
|
+
- lib/rspeckled/plugins/hooks/foreign_keys.rb
|
166
|
+
- lib/rspeckled/plugins/hooks/garbage_collection.rb
|
167
|
+
- lib/rspeckled/plugins/hooks/referehencible.rb
|
168
|
+
- lib/rspeckled/plugins/hooks/request.rb
|
169
|
+
- lib/rspeckled/plugins/hooks/rspec_mocks.rb
|
170
|
+
- lib/rspeckled/plugins/hooks/selenium_webdriver.rb
|
171
|
+
- lib/rspeckled/plugins/hooks/sidekiq.rb
|
172
|
+
- lib/rspeckled/plugins/hooks/singletons.rb
|
173
|
+
- lib/rspeckled/plugins/hooks/stripe.rb
|
174
|
+
- lib/rspeckled/plugins/hooks/timecop.rb
|
175
|
+
- lib/rspeckled/plugins/hooks/vcr.rb
|
176
|
+
- lib/rspeckled/plugins/hooks/warden.rb
|
177
|
+
- lib/rspeckled/plugins/hooks/webmock.rb
|
154
178
|
- lib/rspeckled/reporting.rb
|
155
179
|
- lib/rspeckled/reporting/example.rb
|
156
180
|
- lib/rspeckled/reporting/outputs/csv.rb
|
157
181
|
- lib/rspeckled/reporting/outputs/text.rb
|
158
182
|
- lib/rspeckled/reporting/runner.rb
|
159
|
-
- lib/rspeckled/selenium/drivers/chrome.rb
|
160
|
-
- lib/rspeckled/selenium/drivers/firefox.rb
|
161
183
|
- lib/rspeckled/spec_helpers/active_record_basic.rb
|
162
184
|
- lib/rspeckled/spec_helpers/active_record_connection_setup.rb
|
163
185
|
- lib/rspeckled/spec_helpers/rails.rb
|
@@ -165,7 +187,6 @@ files:
|
|
165
187
|
- lib/rspeckled/spec_helpers/rspeckled.rb
|
166
188
|
- lib/rspeckled/support.rb
|
167
189
|
- lib/rspeckled/tasks/documentation.rake
|
168
|
-
- lib/rspeckled/vcr_matchers/uri_without_trailing_id.rb
|
169
190
|
- lib/rspeckled/version.rb
|
170
191
|
homepage: https://github.com/thekompanee/rspeckled
|
171
192
|
licenses:
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Bullet.enable = true
|
4
|
-
Bullet.bullet_logger = true
|
5
|
-
Bullet.raise = true
|
6
|
-
|
7
|
-
RSpec.configure do |config|
|
8
|
-
config.before(:each) do
|
9
|
-
Bullet.start_request if Bullet.enable?
|
10
|
-
end
|
11
|
-
|
12
|
-
config.after(:each) do
|
13
|
-
if Bullet.enable?
|
14
|
-
Bullet.perform_out_of_channel_notifications if Bullet.notification?
|
15
|
-
Bullet.end_request
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# This plugin does not attempt to require capybara. It assumes that if you're
|
4
|
-
# using capybara, you're probably using something like Bundler which has already
|
5
|
-
# required it for you.
|
6
|
-
#
|
7
|
-
# If this is not the case, you will need to require it prior to requiring
|
8
|
-
# rspeckled.
|
9
|
-
|
10
|
-
require 'capybara/rspec'
|
11
|
-
require 'capybara/rails'
|
12
|
-
require 'rspeckled/selenium/drivers/chrome'
|
13
|
-
require 'rspeckled/selenium/drivers/firefox'
|
14
|
-
|
15
|
-
# Configure Capybara
|
16
|
-
|
17
|
-
Capybara.configure do |config|
|
18
|
-
config.exact = true
|
19
|
-
config.match = :one
|
20
|
-
config.ignore_hidden_elements = true
|
21
|
-
config.visible_text_only = true
|
22
|
-
end
|
23
|
-
|
24
|
-
if defined?(Chamber)
|
25
|
-
Capybara.default_host = Chamber.env.http.base_url
|
26
|
-
Capybara.app_host = Chamber.env.http.base_url
|
27
|
-
Capybara.asset_host = Chamber.env.http.base_url
|
28
|
-
Capybara.server_port = Chamber.env.http.url_components.port
|
29
|
-
end
|
30
|
-
|
31
|
-
Capybara.save_path = "#{Dir.pwd}/tmp/screenshots"
|
32
|
-
|
33
|
-
# Configure Server
|
34
|
-
|
35
|
-
Capybara.register_server :puma do |app, _port, _host|
|
36
|
-
require 'rack/handler/puma'
|
37
|
-
|
38
|
-
host = (defined?(Chamber) && Chamber.env.http.url_components.host) || ENV['HOST'] || 'lvh.me'
|
39
|
-
port = (defined?(Chamber) && Chamber.env.http.url_components.port) || ENV['PORT'] || '3000'
|
40
|
-
|
41
|
-
Rack::Handler::Puma.run(app, :Host => host, :Port => port, :Threads => '0:1', :Silent => true)
|
42
|
-
end
|
43
|
-
|
44
|
-
Capybara.server = :puma
|
45
|
-
|
46
|
-
# Configure Browser Drivers
|
47
|
-
|
48
|
-
downloads_directory = "#{Dir.pwd}/tmp/downloads/"
|
49
|
-
chrome_driver = ::Rspeckled::Selenium::Drivers::Chrome.new(:downloads_directory => downloads_directory)
|
50
|
-
firefox_driver = ::Rspeckled::Selenium::Drivers::Firefox.new(:downloads_directory => downloads_directory)
|
51
|
-
|
52
|
-
Capybara.register_driver(:chrome) { |app| chrome_driver.driver(app) }
|
53
|
-
Capybara.register_driver(:headless_chrome) { |app| chrome_driver.headless(app) }
|
54
|
-
Capybara.register_driver(:firefox) { |app| firefox_driver.driver(app) }
|
55
|
-
Capybara.register_driver(:headless_firefox) { |app| firefox_driver.headless(app) }
|
56
|
-
|
57
|
-
Capybara.javascript_driver = :headless_chrome
|
58
|
-
|
59
|
-
::Selenium::WebDriver.logger.output = 'log/selenium.log' if defined?(::Selenium::WebDriver)
|
60
|
-
|
61
|
-
# Configure Screenshotting
|
62
|
-
|
63
|
-
if defined?(::Capybara::Screenshot)
|
64
|
-
require 'capybara-screenshot/rspec'
|
65
|
-
|
66
|
-
::Capybara::Screenshot.autosave_on_failure = true
|
67
|
-
::Capybara::Screenshot.prune_strategy = :keep_last_run
|
68
|
-
|
69
|
-
::Capybara::Screenshot::RSpec.add_link_to_screenshot_for_failed_examples = false
|
70
|
-
|
71
|
-
::Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
|
72
|
-
example.full_description.downcase.tr(' ', '-').gsub(%r{^.*/spec/}, '')
|
73
|
-
end
|
74
|
-
|
75
|
-
::Capybara::Screenshot.register_driver(:chrome) { |driver, path| driver.browser.save_screenshot(path) }
|
76
|
-
::Capybara::Screenshot.register_driver(:headless_chrome) { |driver, path| driver.browser.save_screenshot(path) }
|
77
|
-
::Capybara::Screenshot.register_driver(:firefox) { |driver, path| driver.browser.save_screenshot(path) }
|
78
|
-
::Capybara::Screenshot.register_driver(:headless_firefox) { |driver, path| driver.browser.save_screenshot(path) }
|
79
|
-
end
|
80
|
-
|
81
|
-
# Configure Example Metadata
|
82
|
-
|
83
|
-
RSpec.configure do |config|
|
84
|
-
config.before(:each, :js => true) do
|
85
|
-
page.driver.reset!
|
86
|
-
end
|
87
|
-
|
88
|
-
# Focus The Browser on Activation
|
89
|
-
|
90
|
-
config.around(:each, :js => true, :autofocus => true) do |example|
|
91
|
-
browser_name = example.metadata[:driver].to_s.capitalize
|
92
|
-
|
93
|
-
Thread.new do
|
94
|
-
sleep 1.5
|
95
|
-
|
96
|
-
`
|
97
|
-
osascript -e '
|
98
|
-
tell the application named "#{browser_name}"
|
99
|
-
activate
|
100
|
-
|
101
|
-
set theWindow to the first item of windows
|
102
|
-
|
103
|
-
if index of theWindow is not 1 then
|
104
|
-
set index to 1
|
105
|
-
set visible to false
|
106
|
-
set visible to true
|
107
|
-
end if
|
108
|
-
end tell
|
109
|
-
' > /dev/null
|
110
|
-
`
|
111
|
-
end
|
112
|
-
|
113
|
-
example.run
|
114
|
-
|
115
|
-
sleep example.metadata[:delay]
|
116
|
-
end
|
117
|
-
|
118
|
-
# Setup Debug Logging
|
119
|
-
|
120
|
-
config.before(:each, :js => true, :debug => true) do
|
121
|
-
Selenium::WebDriver.logger.level = :debug if defined?(Selenium::WebDriver)
|
122
|
-
end
|
123
|
-
|
124
|
-
config.after(:each, :js => true, :debug => true) do
|
125
|
-
Selenium::WebDriver.logger.level = :warn if defined?(Selenium::WebDriver)
|
126
|
-
end
|
127
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
begin
|
4
|
-
autodetected = DatabaseCleaner::Base.new.__send__(:autodetect)
|
5
|
-
rescue DatabaseCleaner::NoORMDetected
|
6
|
-
autodetected = false
|
7
|
-
end
|
8
|
-
|
9
|
-
return unless autodetected
|
10
|
-
|
11
|
-
RSpec.configure do |config|
|
12
|
-
config.before(:suite) do
|
13
|
-
DatabaseCleaner.clean_with(:truncation, :except => %w{ar_internal_metadata})
|
14
|
-
end
|
15
|
-
|
16
|
-
config.around(:each) do |example|
|
17
|
-
DatabaseCleaner.strategy = if example.metadata[:js] || %i{mongoid}.include?(autodetected)
|
18
|
-
[:truncation, :except => %w{ar_internal_metadata}]
|
19
|
-
else
|
20
|
-
:transaction
|
21
|
-
end
|
22
|
-
|
23
|
-
DatabaseCleaner.start
|
24
|
-
|
25
|
-
example.run
|
26
|
-
|
27
|
-
DatabaseCleaner.clean
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
return unless defined?(RSpec::Rails)
|
32
|
-
|
33
|
-
RSpec.configure do |config|
|
34
|
-
config.use_transactional_fixtures = false
|
35
|
-
end
|