rspec-formatter-webkit 2.6.0 → 2.8.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
- SHA1:
3
- metadata.gz: 86a1fd12c87ae8b06be208717d6b6e92d82606f2
4
- data.tar.gz: 4d9cbe72a88090b67939ef3115bfd78b7fa92995
2
+ SHA256:
3
+ metadata.gz: c9a7a8fc42d4f833286592980910937806771ba8ad5aa13aa5c00e7456bfbbef
4
+ data.tar.gz: f553022b3f15fd8e1554cc964827d8180e376f627ab6a722dc4364be7062eef6
5
5
  SHA512:
6
- metadata.gz: b752c435a1b130eed81a91ea780111e8466c847d52b55f2cc030cc459b0b7bfe7f920429cb3cc5b11c023fe1ec9d41acefeb0e66f9fcd2602711ef994ca19fa6
7
- data.tar.gz: 46358a839b07aefbc95a271fc27c2478977da354c89d123e5dad57d782a44c696117c63c1afd54ad0ebc23e83af294bc7e41bb4430ff1718a80a6b68478d03cc
6
+ metadata.gz: 79cd7a74be5e6b9a208300d7ff9b6afdf8bd330333cbae7ff6656874de0fc0f9f5d3c7fe1f40bbe8b82e8d2f070c91f414a6e6aa8ff8f2e288bbb51b9597cc4c
7
+ data.tar.gz: e90d6d53d3bf5e8afddf297e4c744c98a63cbd3557e18515e9c8765a7369ef355fe2ad2f1073306ab4c33f6a7c4c5e2594ae4d3c8c6416dc2b1d11ce7872d86f
checksums.yaml.gz.sig CHANGED
@@ -1,4 +1,3 @@
1
- <��,p"���y�:���:�X����Xe^<�c3@�9��6@X�N�0NmPj��
2
- }�W��{�"��z������������C�?��׍�z��gҀ��/�$�g��:�`��Ͳ?�m5���
3
- W��Y
4
- C�+�l�נ�@9��J�ۨ00�R�( �L��C���-Oa��3M�Y:R�����j�k�=��% �f^X�8�O�#�� w��Q� p�§�
1
+ W�" �G.jn��~�W�~y�w(O��nK�^�_�i9Yn@d��uY�Ҭ�Fx'�ܤ&n,UgW��4)�1���2�'1�������;��:ا�6�,#��>f�� �h�b��ta�Ō�t��Œ��I��ˤ���%�Q.�x�M��L��;N� �Ҭ�� ���Qd�R��k}�ps�������0���#z}��/Jb���[7�&r��/ɗ�>�:�/���T=v��6�@4mqm��d<�9��Q��\�uO2���"���=2;�u�JZ�?~��I��/�#���q�E�-��
2
+
3
+ �9��g��?ŀퟟ�v��օj���W����L� �Ex������\�R7-WĊ8����Cg@�la_��j j��i�
data/History.md ADDED
@@ -0,0 +1,92 @@
1
+ # Release History for rspec-formatter-webkit
2
+
3
+ ---
4
+
5
+
6
+ ## v2.8.0 [2026-02-06] Michael Granger <ged@faeriemud.org>
7
+
8
+ Enhancements:
9
+
10
+ - Change to match latest ERB (6.0+) constructor
11
+
12
+
13
+ ## v2.7.0 [2018-01-17] Michael Granger <ged@FaerieMUD.org>
14
+
15
+ Enhancements:
16
+
17
+ - Remove use of deprecated Gem.datadir
18
+ - Update for Ruby 2.5, RSpec 3.7
19
+
20
+
21
+ ## v2.6.0 [2015-11-16] Michael Granger <ged@FaerieMUD.org>
22
+
23
+ - Updated for RSpec 3.4.
24
+
25
+
26
+ ## v2.5.0 [2015-02-20] Michael Granger <ged@FaerieMUD.org>
27
+
28
+ - Update to Ruby 2.2, RSpec 3.2.
29
+ - Handle a few changes/idiosyncrasies in some versions of RSpec
30
+
31
+
32
+ ## v2.4.0 [2014-02-24] Michael Granger <ged@FaerieMUD.org>
33
+
34
+ - Fix backtrace links for newer 2.x RSpecs
35
+ - Add execution time to examples
36
+ - Change the way the status labels toggle examples to be more useful
37
+
38
+
39
+ ## v2.3.0 [2013-10-07] Michael Granger <ged@FaerieMUD.org>
40
+
41
+ Clean up the stylesheet (thanks to JasonM23)
42
+ - Monospace fonts consistency
43
+ - Updated textmate-rspec.css to use unicode in place of literals
44
+
45
+
46
+ ## v2.2.1 [2013-01-04] Michael Granger <ged@FaerieMUD.org>
47
+
48
+ - Fix shared-group formatting for RSpec 2.12.2.
49
+ - Protect the File.expand_path if $1 is nil
50
+
51
+
52
+ ## v2.2.0 [2012-05-30] Michael Granger <ged@FaerieMUD.org>
53
+
54
+ - Added signature for changeset 429006ee603b
55
+
56
+
57
+ ## v2.2.0 [2012-05-30] Michael Granger <ged@FaerieMUD.org>
58
+
59
+ Added CSS classes for Loggability support.
60
+
61
+
62
+ ## v2.1.5 [2012-01-07] Michael Granger <ged@FaerieMUD.org>
63
+
64
+ Updates for RSpec 2.8.0.
65
+
66
+
67
+ ## v2.1.4 [2011-11-01] Michael Granger <ged@FaerieMUD.org>
68
+
69
+ Updates for Ruby 1.9.3-p0 and RSpec 2.7.x.
70
+
71
+
72
+ ## v2.1.3 [2011-02-16] Michael Granger <ged@FaerieMUD.org>
73
+
74
+ Remove use of deprecated Config.datadir.
75
+
76
+
77
+ ## v2.1.2 [2011-02-09] Michael Granger <ged@FaerieMUD.org>
78
+
79
+ Trying the dependency fix again.
80
+
81
+
82
+ ## v2.1.1 [2011-01-26] Michael Granger <ged@FaerieMUD.org>
83
+
84
+ Adjust dependency on rspec to be less paranoid.
85
+
86
+
87
+ ## v2.1.0 [2010-12-21] Michael Granger <ged@FaerieMUD.org>
88
+
89
+ * Converted to Hoe
90
+ * Renamed from 'rspec-formatter-webkit' to better match gem-naming convention
91
+ * Updated for RSpec 2.3.0.
92
+
data/Manifest.txt CHANGED
@@ -1,8 +1,7 @@
1
- ChangeLog
2
- History.rdoc
1
+ History.md
3
2
  LICENSE
4
3
  Manifest.txt
5
- README.rdoc
4
+ README.md
6
5
  Rakefile
7
6
  data/rspec-formatter-webkit/css/textmate-rspec.css
8
7
  data/rspec-formatter-webkit/images/clock.png
@@ -51,3 +50,5 @@ docs/tmrspec-example.png
51
50
  docs/tmrspecopts-shellvar.png
52
51
  lib/rspec/core/formatters/web_kit.rb
53
52
  lib/rspec/core/formatters/webkit.rb
53
+ spec/rspec/core/formatters/webkit_spec.rb
54
+ spec/spec_helper.rb
@@ -1,27 +1,38 @@
1
- = A WebKit RSpec Formatter
1
+ # A WebKit RSpec Formatter
2
2
 
3
- http://deveiate.org/webkit-rspec-formatter.html
3
+ home
4
+ : https://sr.ht/~ged/rspec-formatter-webkit/
4
5
 
6
+ code
7
+ : https://hg.sr.ht/~ged/rspec-formatter-webkit
5
8
 
6
- == Description
9
+ docs
10
+ : http://deveiate.org/code/rspec-formatter-webkit
7
11
 
8
- This is a formatter for RSpec 2 that takes advantage of features in
9
- WebKit[http://webkit.org/] to make the output from RSpec in Textmate more
10
- fun.
12
+ github
13
+ : https://github.com/ged/rspec-formatter-webkit
14
+
15
+
16
+
17
+ ## Description
18
+
19
+ This is a formatter for RSpec 3 that takes advantage of features in
20
+ [WebKit](http://webkit.org/) to make the output from running specs
21
+ in Textmate more fun/useful.
11
22
 
12
23
  Test output looks like this:
13
24
 
14
25
  http://deveiate.org/images/tmrspec-example.png
15
26
 
16
27
 
17
- == Installation
28
+ ## Installation
18
29
 
19
30
  To get started, install the `rspec-formatter-webkit` gem:
20
31
 
21
32
  $ gem install rspec-formatter-webkit
22
33
 
23
34
 
24
- == Usage
35
+ ## Usage
25
36
 
26
37
  If you're running specs in Textmate 2 via
27
38
  {the RSpec bundle}[http://github.com/rspec/rspec-tmbundle], include
@@ -37,7 +48,7 @@ http://deveiate.org/images/tmrspecopts-shellvar.png
37
48
 
38
49
  That's it!
39
50
 
40
- === Logging Output
51
+ ### Logging Output
41
52
 
42
53
  If you have some kind of log output that you'd like to show up underneath
43
54
  the example, you can append lines of HTML to the <tt>logger-output</tt>
@@ -50,7 +61,7 @@ example line:
50
61
  Each line that has such logging appended will appear with an asterisk after it
51
62
  in the output.
52
63
 
53
- ==== Loggability
64
+ #### Loggability
54
65
 
55
66
  If you're using Loggability for logging, the WebKit formatter has CSS rules for
56
67
  the output of its HTML formatter, and includes a helper for injecting the logs
@@ -65,32 +76,38 @@ helper in your RSpec config:
65
76
  end
66
77
 
67
78
 
68
- == Miscellaneous
79
+ ## Miscellaneous
69
80
 
70
81
  This formatter is also usable anywhere else the standard HTML formatter is, of
71
82
  course. Also, while it's specifically intended to be used under the Textmate
72
83
  HTML viewer that the RSpec bundle uses, the output should work fine under
73
- recent Gecko/Firefox-based viewers, as well.
84
+ recent Gecko/Firefox-based viewers, as well.
74
85
 
75
86
  Patches/suggestions welcomed.
76
87
 
77
88
 
78
- == Contributing
89
+ ## Contributing
79
90
 
80
91
  You can check out the current development source with Mercurial via its
81
- {project page}[ssh://repo.deveiate.org/rspec-formatter-webkit]. Or if you prefer Git, via
92
+ {project page}[ssh://repo.deveiate.org/rspec-formatter-webkit]. Or if you prefer Git, via
82
93
  {its Github mirror}[https://github.com/ged/rspec-formatter-webkit].
83
94
 
84
95
  After checking out the source, run:
85
96
 
86
- $ rake newb
97
+ $ gem install -Ng
98
+ $ rake setup
99
+
100
+ This task will install dependencies and do any necessary developer setup.
101
+
102
+
103
+ ## Authors
87
104
 
88
- This task will install any missing dependencies and generate the API documentation.
105
+ - Michael Granger <ged@faeriemud.org>
89
106
 
90
107
 
91
- == License
108
+ ## License
92
109
 
93
- Copyright (c) 2009-2015, Michael Granger
110
+ Copyright (c) 2009-2026 Michael Granger
94
111
  All rights reserved.
95
112
 
96
113
  Redistribution and use in source and binary forms, with or without
data/Rakefile CHANGED
@@ -1,33 +1,12 @@
1
- #!/usr/bin/env rake
1
+ # -*- ruby -*-
2
2
 
3
- begin
4
- require 'hoe'
5
- rescue LoadError
6
- abort "This Rakefile requires 'hoe' (gem install hoe)"
7
- end
8
-
9
- GEMSPEC = 'rspec-formatter-webkit.gemspec'
10
-
11
- require 'rake/clean'
12
-
13
- Hoe.plugin :mercurial
14
- Hoe.plugin :signing
3
+ require 'rake/deveiate'
15
4
 
16
- Hoe.plugins.delete :rubyforge
17
5
 
18
- hoespec = Hoe.spec 'rspec-formatter-webkit' do
19
- self.readme_file = 'README.rdoc'
20
- self.history_file = 'History.rdoc'
21
- self.extra_rdoc_files = Rake::FileList[ '*.rdoc' ]
22
- self.license 'BSD'
23
-
24
- self.developer 'Michael Granger', 'ged@FaerieMUD.org'
25
- self.license 'Ruby'
26
-
27
- self.dependency 'rspec-core', '~> 3.4'
28
- self.dependency 'hoe-bundler', '~> 1.2', :development
29
-
30
- self.spec_extras[:post_install_message] = %{
6
+ Rake::DevEiate.setup( 'rspec-formatter-webkit' ) do |project|
7
+ project.version_from = 'lib/rspec/core/formatters/webkit.rb'
8
+ project.publish_to = 'deveiate:/usr/local/www/public/code'
9
+ project.post_install_message = <<~END_OF_MESSAGE
31
10
 
32
11
  You can use this formatter from TextMate by setting the TM_RSPEC_OPTS
33
12
  shell variable (in the 'Advanced' preference pane) to:
@@ -36,37 +15,7 @@ hoespec = Hoe.spec 'rspec-formatter-webkit' do
36
15
 
37
16
  Have fun!
38
17
 
39
- }.gsub( /^\t+/m, '' )
40
-
41
- self.require_ruby_version( '>=2.2.0' )
42
- self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags )
43
- self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
18
+ END_OF_MESSAGE
44
19
  end
45
20
 
46
- ENV['VERSION'] ||= hoespec.spec.version.to_s
47
-
48
- # Ensure history is updated before checking in
49
- task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec ]
50
-
51
- task :legacy_gem do
52
- Dir.chdir( 'legacy' ) do
53
- sh 'rake gem'
54
- end
55
- end
56
- CLEAN.include( 'legacy/pkg' )
57
-
58
-
59
- task :gemspec => GEMSPEC
60
-
61
- desc "Refresh the .gemspec"
62
- file GEMSPEC => 'Rakefile' do |task|
63
- spec = hoespec.spec.dup
64
- spec.files.delete( '.gemtest' )
65
- spec.signing_key = nil
66
- spec.version = "#{spec.version}.pre.#{Time.now.strftime("%Y%m%d%H%M%S")}"
67
- File.open( task.name, 'w' ) do |fh|
68
- fh.write( spec.to_ruby )
69
- end
70
- end
71
- CLOBBER.include( '*.gemspec' )
72
21
 
@@ -5,7 +5,7 @@ require 'erb'
5
5
  require 'pathname'
6
6
  require 'set'
7
7
 
8
- gem 'rspec', '~> 3.4.0'
8
+ gem 'rspec', '~> 3.7'
9
9
 
10
10
  require 'rspec'
11
11
  require 'rspec/core/formatters/base_text_formatter'
@@ -25,12 +25,11 @@ class RSpec::Core::Formatters::WebKit < RSpec::Core::Formatters::BaseFormatter
25
25
  include ERB::Util
26
26
 
27
27
  # Version constant
28
- VERSION = '2.6.0'
28
+ VERSION = '2.8.0'
29
29
 
30
30
  # Look up the datadir falling back to a relative path (mostly for prerelease testing)
31
31
  DATADIR = begin
32
- dir = Gem.datadir('rspec-formatter-webkit') ||
33
- Pathname( __FILE__ ).dirname.parent.parent.parent.parent +
32
+ dir = Pathname( __FILE__ ).dirname.parent.parent.parent.parent +
34
33
  'data/rspec-formatter-webkit'
35
34
  Pathname( dir )
36
35
  end
@@ -352,7 +351,11 @@ class RSpec::Core::Formatters::WebKit < RSpec::Core::Formatters::BaseFormatter
352
351
 
353
352
  ### Load the ERB template at +templatepath+ and return it.
354
353
  def load_template( templatepath )
355
- return ERB.new( templatepath.read, nil, '%<>' ).freeze
354
+ if ERB.method( :new ).arity < 3
355
+ return ERB.new( templatepath.read, trim_mode: '%<>' ).freeze
356
+ else
357
+ return ERB.new( templatepath.read, nil, '%<>' ).freeze
358
+ end
356
359
  end
357
360
 
358
361
  end # class RSpec::Core::Formatter::WebKitFormatter
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env rspec -cfd
2
+
3
+ require_relative '../../../spec_helper'
4
+
5
+ require 'stringio'
6
+ require 'rspec/core/formatters/webkit'
7
+
8
+
9
+ RSpec.describe RSpec::Core::Formatters::WebKit do
10
+
11
+ let( :output ) { StringIO.new }
12
+
13
+
14
+ it "renders a header when the run starts" do
15
+ notification = instance_double( RSpec::Core::Notifications::StartNotification,
16
+ count: 8, load_time: 0.245 )
17
+ formatter = described_class.new( output )
18
+ formatter.start( notification )
19
+
20
+ expect( output.string ).to include(
21
+ '<html lang="en">',
22
+ '<title>RSpec results</title>',
23
+ '<div id="rspec-header">'
24
+ )
25
+ end
26
+
27
+
28
+ it "renders a top-level definition list for a top-level example group" do
29
+ group = class_double( RSpec::Core::ExampleGroup, ancestors: [Object],
30
+ name: 'DefinitionListExample', description: "something something" )
31
+ notification = instance_double( RSpec::Core::Notifications::GroupNotification,
32
+ group: group )
33
+ formatter = described_class.new( output )
34
+ formatter.example_group_started( notification )
35
+
36
+ expect( output.string ).to include(
37
+ '<dl>',
38
+ 'something something',
39
+ 'id="definitionlistexample"'
40
+ )
41
+ expect( output.string ).to_not include( '<dd class="nested-group">' )
42
+ end
43
+
44
+
45
+ it "renders a nested definition list for a nested example group" do
46
+ group = class_double( RSpec::Core::ExampleGroup, ancestors: [Object, Object],
47
+ name: 'NestedDefinitionListExample', description: "something nested something" )
48
+ notification = instance_double( RSpec::Core::Notifications::GroupNotification,
49
+ group: group )
50
+ formatter = described_class.new( output )
51
+ formatter.example_group_started( notification )
52
+
53
+ expect( output.string ).to include(
54
+ '<dd class="nested-group">',
55
+ '<dl>',
56
+ 'something nested something',
57
+ 'id="nesteddefinitionlistexample"'
58
+ )
59
+ end
60
+
61
+
62
+ it "closes previous more-deeply nested definition lists" do
63
+ group1 = class_double( RSpec::Core::ExampleGroup, ancestors: [Object, Object, Object, Object],
64
+ name: 'DefinitionListExampleOne', description: "first group" )
65
+ notification1 = instance_double( RSpec::Core::Notifications::GroupNotification,
66
+ group: group1 )
67
+
68
+ group2 = class_double( RSpec::Core::ExampleGroup, ancestors: [Object, Object],
69
+ name: 'DefinitionListExampleTwo', description: "second group" )
70
+ notification2 = instance_double( RSpec::Core::Notifications::GroupNotification,
71
+ group: group2 )
72
+
73
+ formatter = described_class.new( output )
74
+
75
+ formatter.example_group_started( notification1 )
76
+ output.truncate( 0 )
77
+ output.rewind
78
+ formatter.example_group_started( notification2 )
79
+
80
+ expect( output.string ).to match( %r{</dd>.*</dl>.*</dd>.*</dl>}m )
81
+ end
82
+
83
+ end
84
+
@@ -0,0 +1,26 @@
1
+ # -*- ruby -*-
2
+ #encoding: utf-8
3
+
4
+ require 'rspec'
5
+
6
+ RSpec.configure do |config|
7
+ config.expect_with :rspec do |expectations|
8
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
9
+ end
10
+
11
+ config.mock_with :rspec do |mocks|
12
+ mocks.verify_partial_doubles = true
13
+ end
14
+
15
+ config.shared_context_metadata_behavior = :apply_to_host_groups
16
+ config.filter_run_when_matching :focus
17
+ config.example_status_persistence_file_path = "spec/.status"
18
+ config.disable_monkey_patching!
19
+ config.warnings = true
20
+ config.profile_examples = 10
21
+ config.order = :random
22
+
23
+ Kernel.srand( config.seed )
24
+ end
25
+
26
+
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- J�����^����\
1
+ ��4g3�St衹���~ی�(�^��z3�