summary refs log tree commit
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-05-10 10:44:49 -0700
committerJeremy Evans <code@jeremyevans.net>2022-05-25 08:33:11 -0700
commit862006023952583c26901998a4ae64431922e0fa (patch)
treef009c7b25d5fe565a5fba8186753432d28ff2ffa
parentcf29914d96ac81fe938d658c826582dc010d8e0a (diff)
downloadrack-862006023952583c26901998a4ae64431922e0fa.tar.gz
Add nocov markers around branches that depends on Ruby version
-rw-r--r--lib/rack/body_proxy.rb2
-rw-r--r--lib/rack/headers.rb4
-rw-r--r--lib/rack/rewindable_input.rb2
3 files changed, 8 insertions, 0 deletions
diff --git a/lib/rack/body_proxy.rb b/lib/rack/body_proxy.rb
index cfc0796a..ea798cfd 100644
--- a/lib/rack/body_proxy.rb
+++ b/lib/rack/body_proxy.rb
@@ -40,6 +40,8 @@ module Rack
     def method_missing(method_name, *args, &block)
       @body.__send__(method_name, *args, &block)
     end
+    # :nocov:
     ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
+    # :nocov:
   end
 end
diff --git a/lib/rack/headers.rb b/lib/rack/headers.rb
index cc764a0d..153c1b22 100644
--- a/lib/rack/headers.rb
+++ b/lib/rack/headers.rb
@@ -115,7 +115,9 @@ module Rack
       keys.map{|key| self[key]}
     end
     
+    # :nocov:
     if RUBY_VERSION >= '2.5'
+    # :nocov:
       def slice(*a)
         h = self.class.new
         a.each{|k| h[k] = self[k] if has_key?(k)}
@@ -135,7 +137,9 @@ module Rack
       end
     end
 
+    # :nocov:
     if RUBY_VERSION >= '3.0'
+    # :nocov:
       def except(*a)
         super(*a.map!{|key| downcase_key(key)})
       end
diff --git a/lib/rack/rewindable_input.rb b/lib/rack/rewindable_input.rb
index 413d35e1..ec4d4fc5 100644
--- a/lib/rack/rewindable_input.rb
+++ b/lib/rack/rewindable_input.rb
@@ -85,10 +85,12 @@ module Rack
       @rewindable_io.chmod(0000)
       @rewindable_io.set_encoding(Encoding::BINARY) if @rewindable_io.respond_to?(:set_encoding)
       @rewindable_io.binmode
+      # :nocov:
       if filesystem_has_posix_semantics?
         raise 'Unlink failed. IO closed.' if @rewindable_io.closed?
         @unlinked = true
       end
+      # :nocov:
 
       buffer = "".dup
       while @io.read(1024 * 4, buffer)