test-unit-rails 5.1.2 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d09214684384ef1813ada6af30fde98a7a7c8d4a
4
- data.tar.gz: 555a31e62642852a04057e6c74fb9ec743aa3e45
2
+ SHA256:
3
+ metadata.gz: aa8c2bbbbc61a067c2e6038c50e7f8df831c8f669c3fd57b5954e43e5037630b
4
+ data.tar.gz: 5d1627e0c1ca92d60fa45938ad20ebd4b4da5a8275956f49d47812ca763a185e
5
5
  SHA512:
6
- metadata.gz: 741cf66e14ae012c72cb939bfe2bc27264b4e279a19df548218881c65a389a27fbf8b5e46af0f5b035119a7fd431cf5d4b2cbe2916d4d771aaed97ed918c43d2
7
- data.tar.gz: e9d0fb0436007a6e761c9ef8ae1f58f0d002f148e8f1ad57441568212321f828d3c09ba21b0eb6ec5b4bcefa893b63251c1b99201ce40aecae10580eab4d8eca
6
+ metadata.gz: 8b930d93d630ef30b1ac1bbba739b0b89f6a2d7475c1d70aa50c58a0ded5bc2ed2d1f13e53640ab58ff05f6ed64ed46fa00f1ac557aa2b6c749a6505a95f4edb
7
+ data.tar.gz: 60c97c1f7b042b22583b4403c7f1fc063f9c1f6025b34f8d80cc773ade82baeb37f9fddd0b9f9ca07b5b038de35ed6d7150b47097cea326fa23ee3a00f5411ce
data/Rakefile CHANGED
@@ -27,6 +27,7 @@ require 'packnga'
27
27
  task :default => :test
28
28
 
29
29
  base_dir = File.join(File.dirname(__FILE__))
30
+ html_base_dir = File.join(base_dir, "doc", "html")
30
31
 
31
32
  class Bundler::GemHelper
32
33
  def version_tag
@@ -48,6 +49,13 @@ document_task = Packnga::DocumentTask.new(spec) do |task|
48
49
  end
49
50
 
50
51
  Packnga::ReleaseTask.new(spec) do |task|
52
+ test_unit_github_io_dir_candidates = [
53
+ "../../www/test-unit.github.io",
54
+ ]
55
+ test_unit_github_io_dir = test_unit_github_io_dir_candidates.find do |dir|
56
+ File.directory?(dir)
57
+ end
58
+ task.index_html_dir = test_unit_github_io_dir
51
59
  end
52
60
 
53
61
  desc "Run test"
@@ -1,5 +1,59 @@
1
1
  # News
2
2
 
3
+ ## 6.1.0 - 2021-01-13 {#version-6-1-0}
4
+
5
+ ### Improvements
6
+
7
+ * Added support for Rails 6.1.
8
+ [GitHub#23][Reported by Shugo Maeda]
9
+
10
+ ### Thanks
11
+
12
+ * Shugo Maeda
13
+
14
+ ## 6.0.0 - 2019-07-11 {#version-6-0-0}
15
+
16
+ ### Improvements
17
+
18
+ * Added support for Rails 6.0.
19
+
20
+ * Stopped to load `test_helper.rb`.
21
+
22
+ ## 5.2.2 - 2018-08-20 {#version-5-2-2}
23
+
24
+ ### Improvements
25
+
26
+ * Added support for Rails 5.1 without Puma.
27
+ [GitHub#21][Patch by neko maho]
28
+
29
+ ### Thanks
30
+
31
+ * neko maho
32
+
33
+ ## 5.2.1 - 2018-08-10 {#version-5-2-1}
34
+
35
+ ### Improvements
36
+
37
+ * Added support for `ActionDispatch::SystemTestCase`.
38
+ [GitHub#20][Patch by okkez]
39
+
40
+ ### Thanks
41
+
42
+ * okkez
43
+
44
+ ## 5.1.3 - 2017-07-28 {#version-5-1-3}
45
+
46
+ ### Improvements
47
+
48
+ * Removed test-unit-notify dependency.
49
+
50
+ * Added `test:system` task support.
51
+ [GitHub#17][Patch by naofumi-fujii]
52
+
53
+ ### Thanks
54
+
55
+ * naofumi-fujii
56
+
3
57
  ## 5.1.2 - 2017-07-05 {#version-5-1-2}
4
58
 
5
59
  ### Improvements
@@ -26,11 +26,12 @@ module Rails
26
26
  end
27
27
  end
28
28
 
29
- def perform(*)
29
+ def perform(*args)
30
30
  $LOAD_PATH << Rails::Command.root.join("test").to_s
31
31
 
32
- ARGV.unshift("--default-test-path=test")
33
- exit(Test::Unit::AutoRunner.run(true))
32
+ args.unshift("--exclude=\\Atest_helper\\.rb\\z")
33
+ args.unshift("--default-test-path=test")
34
+ exit(Test::Unit::AutoRunner.run(true, nil, args))
34
35
  end
35
36
  end
36
37
  end
@@ -19,7 +19,6 @@ if Rails.env.production?
19
19
  end
20
20
 
21
21
  require "test/unit/active_support"
22
- require "test/unit/notify"
23
22
  require "test/unit/rr"
24
23
  require "test/unit/capybara"
25
24
 
@@ -50,6 +49,10 @@ end
50
49
 
51
50
  class ActiveSupport::TestCase
52
51
  self.file_fixture_path = "#{Rails.root}/test/fixtures/files" if respond_to?(:file_fixture_path=)
52
+
53
+ def skipped?
54
+ current_result.omission_count > 0
55
+ end
53
56
  end
54
57
 
55
58
  if defined?(ActiveRecord::Base)
@@ -87,3 +90,20 @@ class ActionDispatch::IntegrationTest
87
90
  end
88
91
  include Capybara::DSL
89
92
  end
93
+
94
+ begin
95
+ require "action_dispatch/system_test_case"
96
+ rescue LoadError
97
+ else
98
+ class ActionDispatch::SystemTestCase
99
+ setup before: :prepend do
100
+ self.class.driver.use
101
+ end
102
+
103
+ # take screenshot before reset session
104
+ teardown after: :prepend do
105
+ take_failed_screenshot
106
+ Capybara.reset_sessions!
107
+ end
108
+ end
109
+ end
@@ -29,6 +29,7 @@ namespace :test do
29
29
  "mailers",
30
30
  "integration",
31
31
  "jobs",
32
+ "system",
32
33
  ].each do |component|
33
34
  Rake.application["test:#{component}"].clear_actions
34
35
  task component do
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2021 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,7 @@
17
17
  module Test
18
18
  module Unit
19
19
  module Rails
20
- VERSION = "5.1.2"
20
+ VERSION = "6.1.0"
21
21
  end
22
22
  end
23
23
  end
@@ -21,17 +21,22 @@ require "rails/all"
21
21
  # For Rack::Builder#to_app
22
22
  module TestUnitRails
23
23
  class Application < ::Rails::Application
24
+ ::Rails.logger = config.logger = ActiveSupport::Logger.new($stdout)
24
25
  end
25
26
  end
26
27
 
27
28
  require "test/unit/rails/test_help"
29
+ require "selenium-webdriver"
28
30
 
29
31
  Rails.application.secrets[:secret_key_base] = 'xxx'
30
32
  Rails.application.routes.draw do
31
33
  resources :items
32
34
  end
33
35
 
34
- class ItemsController
36
+ class ItemsController < ActionController::Base
37
+ def index
38
+ render plain: "Hello"
39
+ end
35
40
  end
36
41
 
37
42
  require "fileutils"
@@ -0,0 +1,20 @@
1
+ require "test_helper"
2
+
3
+ if ActionDispatch::SystemTesting.const_defined?(:Server)
4
+ class TestSystemTestCase < ActionDispatch::SystemTestCase
5
+ have_browser = ActionDispatch::SystemTesting.const_defined?(:Browser)
6
+ if have_browser
7
+ driver = :selenium
8
+ driven_by driver, using: :headless_chrome, screen_size: [1920, 1080]
9
+ else
10
+ driver = :selenium_chrome_headless
11
+ driven_by driver, screen_size: [1920, 1080]
12
+ end
13
+
14
+ test "render text" do
15
+ assert_equal(driver, Capybara.current_driver)
16
+ visit("/items")
17
+ assert_text("Hello")
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-unit-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-05 00:00:00.000000000 Z
11
+ date: 2021-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.8
41
- - !ruby/object:Gem::Dependency
42
- name: test-unit-notify
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: test-unit-capybara
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -164,9 +150,23 @@ dependencies:
164
150
  - - ">="
165
151
  - !ruby/object:Gem::Version
166
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: selenium-webdriver
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
167
  description: 'Rails supports Minitest but doesn''t support test-unit.
168
168
 
169
- '
169
+ '
170
170
  email:
171
171
  - kou@clear-code.com
172
172
  executables: []
@@ -188,6 +188,7 @@ files:
188
188
  - test/test_action_controller.rb
189
189
  - test/test_action_dispatch.rb
190
190
  - test/test_helper.rb
191
+ - test/test_system_test_case.rb
191
192
  homepage: https://github.com/test-unit/test-unit-rails
192
193
  licenses:
193
194
  - LGPLv2 or later
@@ -207,15 +208,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
208
  - !ruby/object:Gem::Version
208
209
  version: '0'
209
210
  requirements: []
210
- rubyforge_project:
211
- rubygems_version: 2.5.2
211
+ rubygems_version: 3.3.0.dev
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: test-unit-rails is a Rails adapter for test-unit gem. You can use full test-unit
215
215
  gem features, [RR](https://rubygems.org/gems/rr) integration and [Capybara](https://rubygems.org/gems/capybara)
216
216
  integration with test-unit-rails.
217
217
  test_files:
218
- - test/test_action_controller.rb
219
218
  - test/run-test.rb
219
+ - test/test_action_controller.rb
220
220
  - test/test_action_dispatch.rb
221
221
  - test/test_helper.rb
222
+ - test/test_system_test_case.rb