teaspoon 1.2.1 → 1.4.0

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: 87a2167152fd03a542d32f164a5dfb521f6db314a553d8d8b6f108efab669635
4
- data.tar.gz: 2e8fad35367a9d663adc6d220f2a65c768b00c8742fea7b5acd0b3e522539b17
3
+ metadata.gz: f2395822f24d2ede9cc8b2ae7a1445d3f2babb19c3476211a78889f34bf8e941
4
+ data.tar.gz: 1bf8c93878c6a42939fbad422a26229eab74b455336d3d74d09f564e9725ab15
5
5
  SHA512:
6
- metadata.gz: cdb23553e3231e9afc7848dc4bd2f7237e50888ea77118f3fb5f27c4c216c1743bab2a1b14fd5c16f0fb267442da61d4a9dc96b60bb8337236e15a63b2084d16
7
- data.tar.gz: 07f1907cfc1592fed2c314a06efa79c7e41cd744c5b7a1600c39ffc4a00e13bc303dda559bc53d73b65c8b6021004d85fbd5854c137cdf1eb77d4105e55c0f65
6
+ metadata.gz: cacc87946f0a2699ecd20976c41757a4a52c47c3071a61cd27d4de662b06142cdb70f027a101dbc2394b0ce22a6db7f662953cc78642c92fff000a1a4005846a
7
+ data.tar.gz: cad67f5194f87b634cc84407da1296fb8aa709443f69757c13ee21dc8913db8bf7ccd7dade0b378ac49160e21d8375826980ae62e0b65d8645b684474ccccefb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  ### Unreleased
2
2
 
3
+ * Support for (webpacker)[https://github.com/rails/webpacker/].
4
+ ```ruby
5
+ suite.javascript_packs += ["your-custom-pack.js"]
6
+ ```
7
+
8
+ ### 1.4.0 Sep 8, 2023
9
+
10
+ * Fix CI
11
+ * Unfortunately disable a few tests with Ruby 3.x, they still pass with 2.x
12
+ * Adding support for multiple test suites through options #511
13
+ * fix instrumentation to support puma >= 6.2 (#600) (#601)
14
+
15
+ ### 1.3.0 Mar 19, 2021
16
+
17
+ * Officially drops support for Ruby 2.4 and Rails earlier than 4.2.11
18
+
19
+ ### 1.2.2
20
+
21
+ * make sure all tests pass with rails 4.2 - 6.1 (few pending excluded PR welcome)
22
+ * ruby supported 2.5 to 2.7 works, unknown about 3.0
23
+ * remove monkey-patch on `javascript_include_tag`
24
+
3
25
  ### 1.2.1
4
26
 
5
27
  * require utility in console to get Teaspoon.root (#562)
@@ -31,7 +53,7 @@
31
53
  #### Bug Fixes
32
54
 
33
55
  * Fixes an ActionView version related issue.
34
- * Changes before_filter to before_action where possible (Rails 3 vs. Rails 5)
56
+ * Changes `before_filter` to `before_action` where possible (Rails 3 vs. Rails 5)
35
57
 
36
58
 
37
59
  ### 1.1.4
@@ -1,4 +1,4 @@
1
- <%= javascript_include_tag *@suite.spec_assets, debug: @suite.config.expand_assets, allow_non_precompiled: true %>
1
+ <%= javascript_include_tag *@suite.spec_assets, debug: @suite.config.expand_assets %>
2
2
  <script type="text/javascript">
3
3
  Teaspoon.onWindowLoad(Teaspoon.execute);
4
4
  </script>
@@ -7,6 +7,9 @@
7
7
 
8
8
  <%= stylesheet_link_tag *@suite.stylesheets %>
9
9
  <%= javascript_include_tag *@suite.javascripts %>
10
+ <% @suite.javascript_packs.each do |javascript_pack| %>
11
+ <%= javascript_pack_tag javascript_pack %>
12
+ <% end %>
10
13
  <script type="text/javascript">
11
14
  Teaspoon.version = <%= Teaspoon::VERSION.to_json.html_safe %>;
12
15
  Teaspoon.suites = <%= {all: Teaspoon.configuration.suite_configs.keys, active: @suite.name}.to_json.html_safe %>;
@@ -1,4 +1,4 @@
1
- <%= javascript_include_tag *@suite.spec_assets, debug: @suite.config.expand_assets, allow_non_precompiled: true %>
1
+ <%= javascript_include_tag *@suite.spec_assets, debug: @suite.config.expand_assets %>
2
2
  <script type="text/javascript">
3
3
  Teaspoon.onWindowLoad(Teaspoon.execute);
4
4
  </script>
@@ -61,7 +61,7 @@ module Teaspoon
61
61
  end
62
62
 
63
63
  class Suite
64
- attr_accessor :matcher, :helper, :javascripts, :stylesheets,
64
+ attr_accessor :matcher, :helper, :javascripts, :javascript_packs, :stylesheets,
65
65
  :boot_partial, :body_partial,
66
66
  :hooks, :expand_assets, :js_extensions
67
67
 
@@ -70,6 +70,7 @@ module Teaspoon
70
70
  @helper = "spec_helper"
71
71
  @javascripts = []
72
72
  @stylesheets = ["teaspoon"]
73
+ @javascript_packs = []
73
74
 
74
75
  @boot_partial = "boot"
75
76
  @body_partial = "body"
@@ -85,7 +85,7 @@ module Teaspoon
85
85
  end
86
86
 
87
87
  def suites
88
- return [options[:suite]] if options[:suite].present?
88
+ return options[:suite].split(',') if options[:suite].present?
89
89
  return @suites.keys if @suites.present?
90
90
  Teaspoon.configuration.suite_configs.keys
91
91
  end
@@ -101,25 +101,14 @@ module Teaspoon
101
101
  end
102
102
  end
103
103
 
104
- begin
105
- require "action_view"
106
- if ActionView.gem_version >= Gem::Version.new("4.2.5")
107
- require "action_view/helpers/asset_tag_helper"
108
- module ActionView::Helpers::AssetTagHelper
109
- def javascript_include_tag(*sources)
110
- options = sources.extract_options!.stringify_keys
111
- path_options = options.extract!("protocol", "extname", "host").symbolize_keys
112
- path_options[:debug] = options["allow_non_precompiled"]
113
- sources.uniq.map { |source|
114
- tag_options = {
115
- "src" => path_to_javascript(source, path_options)
116
- }.merge!(options)
117
- content_tag(:script, "", tag_options)
118
- }.join("\n").html_safe
119
- end
104
+ class Sprockets::Rails::HelperAssetResolvers::Environment
105
+ def raise_unless_precompiled_asset(path)
106
+ if Rails.env.test? or Rails.env.development?
107
+ # nothing, thank you
108
+ else
109
+ super
120
110
  end
121
111
  end
122
- rescue
123
112
  end
124
113
 
125
114
  # Some Sprockets patches to work with Sprockets 2.x
@@ -35,10 +35,8 @@ module Teaspoon
35
35
 
36
36
  result = add_instrumentation(asset)
37
37
 
38
- asset.instance_variable_set(:@source, result)
39
- asset.instance_variable_set(:@length, headers["Content-Length"] = result.bytesize.to_s)
40
-
41
- [status, headers, asset]
38
+ headers["Content-Length"] = result.bytesize.to_s
39
+ [status, headers, [result]]
42
40
  end
43
41
 
44
42
  protected
@@ -13,7 +13,7 @@ module Teaspoon
13
13
  end
14
14
 
15
15
  attr_accessor :config, :name
16
- delegate :helper, :stylesheets, :javascripts, :boot_partial, :body_partial, :hooks,
16
+ delegate :helper, :stylesheets, :javascripts, :javascript_packs, :boot_partial, :body_partial, :hooks,
17
17
  to: :config
18
18
 
19
19
  def initialize(options = {})
@@ -1,3 +1,3 @@
1
1
  module Teaspoon
2
- VERSION = "1.2.1"
2
+ VERSION = "1.4.0"
3
3
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teaspoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jejacks0n
8
8
  - mikepack
9
9
  - jayzes
10
10
  - jedschneider
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-03-16 00:00:00.000000000 Z
14
+ date: 2023-09-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties
@@ -19,14 +19,42 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.2.5
22
+ version: '5.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 3.2.5
29
+ version: '5.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: simplecov
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '0.18'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "<"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.18'
44
+ - !ruby/object:Gem::Dependency
45
+ name: webrick
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
30
58
  description: Run your Javascript tests using Jasmine, Mocha or QUnit using a variety
31
59
  of platforms.
32
60
  email:
@@ -127,7 +155,7 @@ homepage: https://github.com/jejacks0n/teaspoon
127
155
  licenses:
128
156
  - MIT
129
157
  metadata: {}
130
- post_install_message:
158
+ post_install_message:
131
159
  rdoc_options: []
132
160
  require_paths:
133
161
  - lib
@@ -135,15 +163,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - ">="
137
165
  - !ruby/object:Gem::Version
138
- version: '2.4'
166
+ version: '2.7'
139
167
  required_rubygems_version: !ruby/object:Gem::Requirement
140
168
  requirements:
141
169
  - - ">="
142
170
  - !ruby/object:Gem::Version
143
171
  version: '0'
144
172
  requirements: []
145
- rubygems_version: 3.0.8
146
- signing_key:
173
+ rubygems_version: 3.4.18
174
+ signing_key:
147
175
  specification_version: 4
148
176
  summary: 'Teaspoon: A Javascript test runner built on top of Rails'
149
177
  test_files: []