rspeckled 0.0.33 → 0.0.34

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
  SHA1:
3
- metadata.gz: 151e1c5129af9d587ce007f33367e125a06bb20c
4
- data.tar.gz: 97ea08ada33a522585a9c7c53e293c0cb0e436c8
3
+ metadata.gz: daf53aabd68d518600a2cff9de16871c4760ed60
4
+ data.tar.gz: bc6c02c6128353d1fcfd8f910279056800bccb78
5
5
  SHA512:
6
- metadata.gz: e751a532b20c590d095012420493f7d889a8d2104d9f6d344ac363e5d61f73c9aeb66b096e3e29511222b37cc632f54b973bbc84cecf3e250248d0f35a788161
7
- data.tar.gz: d3f1ef796925ead8176ef4e7015ab36f2c26c2cd12fc3f9952bcf2c6fb8abc2327629a403a56bc6e90c144ff2bfc91a923f0dfa33360efd74322f0c0c45bfb94
6
+ metadata.gz: 7a92c20fbb3efbc2b7b41e087af9bb3fb99cef3dbe261263934190c705c8b10586671df995c9c8ad1c1b1cbe5034b4b7f281c50e142985d3750562ea0e59e9ef
7
+ data.tar.gz: 17e55ca7b5612f68ddec7bc6b300bb229a0ce1a9ae5f2d4a53b011b5cf24342dc1ef7781ccf1bb2c8666db1fd31ba96696d88048afee5e5f01f0300c06875511
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -17,6 +17,7 @@ require 'rspeckled/plugins/faraday'
17
17
  require 'rspeckled/plugins/foreign_keys'
18
18
  require 'rspeckled/plugins/omniauth'
19
19
  require 'rspeckled/plugins/mocks'
20
+ require 'rspeckled/plugins/mongoid'
20
21
  require 'rspeckled/plugins/pretty_print'
21
22
  require 'rspeckled/plugins/rails/engine'
22
23
  require 'rspeckled/plugins/rails/strong_parameters'
@@ -18,12 +18,50 @@ begin
18
18
  require 'capybara/rails'
19
19
 
20
20
  if defined?(Capybara::Driver::Base)
21
+ downloads_directory = "#{Dir.pwd}/tmp/downloads/"
22
+ Dir.mkdir(downloads_directory) unless Dir.exist?(downloads_directory)
23
+
24
+ chrome_options = {
25
+ 'chromeOptions' => {
26
+ 'prefs' => {
27
+ 'profile.default_content_settings.popups' => 0,
28
+ 'download.default_directory' => downloads_directory,
29
+ },
30
+ 'args' => %w{
31
+ window-size=1920,1200
32
+ },
33
+ },
34
+ }
35
+
21
36
  Capybara.register_driver :chrome do |app|
22
- Capybara::Selenium::Driver.new(app, :browser => :chrome)
37
+ Capybara::Selenium::Driver.new(
38
+ app,
39
+ :browser => :chrome,
40
+ :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome(chrome_options)
41
+ )
42
+ end
43
+
44
+ headless_chrome_options = chrome_options.dup
45
+ headless_chrome_options['chromeOptions']['binary'] = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
46
+ headless_chrome_options['chromeOptions']['args'] << 'headless'
47
+ headless_chrome_options['chromeOptions']['args'] << 'disable-gpu'
48
+
49
+ Capybara.register_driver :headless_chrome do |app|
50
+ Capybara::Selenium::Driver.new(
51
+ app,
52
+ :browser => :chrome,
53
+ :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome(headless_chrome_options)
54
+ )
23
55
  end
24
56
 
57
+ firefox_profile = Selenium::WebDriver::Firefox::Profile.new
58
+ firefox_profile['browser.download.dir'] = downloads_directory
59
+ firefox_profile['browser.download.folderList'] = 2
60
+ firefox_profile['browser.helperApps.neverAsk.saveToDisk'] = 'images/jpeg, application/pdf, application/octet-stream'
61
+ firefox_profile['pdfjs.disabled'] = true
62
+
25
63
  Capybara.register_driver :firefox do |app|
26
- Capybara::Selenium::Driver.new(app, :browser => :firefox)
64
+ Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => firefox_profile)
27
65
  end
28
66
 
29
67
  if defined?(Selenium::WebDriver)
@@ -20,7 +20,7 @@ begin
20
20
  end
21
21
 
22
22
  config.around(:each) do |example|
23
- DatabaseCleaner.strategy = if example.metadata[:js]
23
+ DatabaseCleaner.strategy = if example.metadata[:js] || %i{mongoid}.include?(autodetected)
24
24
  [:truncation, :except => %w{ar_internal_metadata}]
25
25
  else
26
26
  :transaction
@@ -10,8 +10,8 @@ begin
10
10
  Devise.stretches = 1
11
11
 
12
12
  RSpec.configure do |config|
13
- config.include Devise::TestHelpers, :type => :controller
14
- config.include Warden::Test::Helpers, :type => :feature
13
+ config.include Devise::Test::ControllerHelpers, :type => :controller
14
+ config.include Warden::Test::Helpers, :type => :feature
15
15
 
16
16
  config.before(:all, :type => :feature) do |_example|
17
17
  Warden.test_mode!
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##############################################################################
4
+ # Mongoid Plugin
5
+ ##############################################################################
6
+
7
+ begin
8
+ require 'mongoid-rspec'
9
+
10
+ RSpec.configure do |config|
11
+ config.include Mongoid::Matchers
12
+ end
13
+ rescue LoadError
14
+ end
@@ -42,6 +42,14 @@ RSpec.configure do |config|
42
42
  config.include ActionView::Helpers::TranslationHelper
43
43
  end
44
44
 
45
+ ##############################################################################
46
+ # PROFILING
47
+ ##############################################################################
48
+
49
+ if config.files_to_run.length > 1
50
+ config.profile_examples = [(config.files_to_run.length * 0.1).to_i, 10].max
51
+ end
52
+
45
53
  ##############################################################################
46
54
  # FORMATTING
47
55
  ##############################################################################
@@ -83,6 +91,9 @@ RSpec.configure do |config|
83
91
  config.order = 'random'
84
92
  config.run_all_when_everything_filtered = true
85
93
 
94
+ # Make all randomization deterministic based on the random run order seed
95
+ Kernel.srand config.seed
96
+
86
97
  ##############################################################################
87
98
  # PERSISTENT FAILURES
88
99
  ##############################################################################
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rspeckled
4
- VERSION = '0.0.33'
4
+ VERSION = '0.0.34'
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: 0.0.33
4
+ version: 0.0.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - thegranddesign
@@ -12,26 +12,26 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDqjCCApKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBNMREwDwYDVQQDDAhydWJ5
14
14
  Z2VtczEjMCEGCgmSJomT8ixkARkWE2xpdmluZ2hpZ2hvbnRoZWJsb2cxEzARBgoJ
15
- kiaJk/IsZAEZFgNjb20wHhcNMTYwNTAxMDIzMDIzWhcNMTcwNTAxMDIzMDIzWjBN
15
+ kiaJk/IsZAEZFgNjb20wHhcNMTcwODAyMjI1OTM1WhcNMTgwODAyMjI1OTM1WjBN
16
16
  MREwDwYDVQQDDAhydWJ5Z2VtczEjMCEGCgmSJomT8ixkARkWE2xpdmluZ2hpZ2hv
17
17
  bnRoZWJsb2cxEzARBgoJkiaJk/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUA
18
- A4IBDwAwggEKAoIBAQC/Oxo4PMAOCC3dfzGt7DZJwoDY9MGBXoWkbWIEP91yyKIB
19
- mWheQ1epDXkj1R6SM1+iclwgUKJQvFrSeD5i1NS9+3qRrD6gPCf3RDAbWNdUpyei
20
- F/W4+G7eCxGC6FHv7WsBjrGWQVTjZtKYOiQCxwwkPlZSX8aBXViO8D9bZJAURocY
21
- CbsMGeS0sPISRb0GCnI8VOIoab7GM8tdmIj4Uv0lzp4uOlKRJBss5/Sjp1mjgCvI
22
- vuXy0X+r1l2xiXL3/uTT/Tch3lPWctEEDw9rUzNz0N5oTGK4vooq4m4AIzU1pa1Z
23
- ZneO33rn3QVWVpOsK6NQVpBNhSism+Ju1mlvdmKFAgMBAAGjgZQwgZEwCQYDVR0T
24
- BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFLpr4AqEQwV9hUch3fxKvCkHUw3i
18
+ A4IBDwAwggEKAoIBAQDtLa7+7p49gW15OgOyRZad/F92iZcMdDjZ2kAxZlviXgVe
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NgrAtehd8USUd
29
+ CiJJGH+yvGNWug9IGZCGX91HIbTsLQ5IUUWQasC5jGP8nxXufUr9xgAJZZenewny
30
+ B2qKu8q1A/kj6cw62RCY7yBmUXxlcJBj8g+JKYAFbYYKUdQSzf50k9IiWLWunJM+
31
+ Y2GAoHKstmfIVhc4XHOPpmTd2o/C29O9oaRgjrkfQEhF/KvJ/PhoV5hvokzsCyI5
32
+ iUeXPfvrGD/itYIBCgk+fnzyQQ4QtE5hTQaWQ3o2
33
33
  -----END CERTIFICATE-----
34
- date: 2017-04-24 00:00:00.000000000 Z
34
+ date: 2017-12-18 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
@@ -89,11 +89,10 @@ dependencies:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '1.1'
92
- description: 'Are you copying and pasting your RSpec configurations into each of your
92
+ description: Are you copying and pasting your RSpec configurations into each of your
93
93
  projects like some kind of ANIMAL? Use Rspeckled to cure your woes.
94
-
95
- '
96
- email: rubygems@livinghighontheblog.com
94
+ email:
95
+ - rubygems@livinghighontheblog.com
97
96
  executables: []
98
97
  extensions: []
99
98
  extra_rdoc_files: []
@@ -128,6 +127,7 @@ files:
128
127
  - lib/rspeckled/plugins/foreign_keys.rb
129
128
  - lib/rspeckled/plugins/garbage_collection.rb
130
129
  - lib/rspeckled/plugins/mocks.rb
130
+ - lib/rspeckled/plugins/mongoid.rb
131
131
  - lib/rspeckled/plugins/omniauth.rb
132
132
  - lib/rspeckled/plugins/pretty_print.rb
133
133
  - lib/rspeckled/plugins/rails/engine.rb
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.6.8
177
+ rubygems_version: 2.6.13
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Stop Copying and Pasting Your RSpec Configuration
metadata.gz.sig CHANGED
Binary file