File: ruby-2.5-test-fix.patch

package info (click to toggle)
ruby-rspec-its 1.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 160 kB
  • sloc: ruby: 307; sh: 7; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 1,403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Description: Fix tests to pass with Ruby 2.5
Author: Jon Rowe <hello@jonrowe.co.uk>
Applied-Upstream: https://github.com/rspec/rspec-its/commit/bfaab439c7c879f5ef25552f41827891f6308373
Last-Update: 2018-02-27
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/spec/rspec/its_spec.rb
+++ b/spec/rspec/its_spec.rb
@@ -55,7 +55,11 @@
           end
           its("name") { should eq("John") }
           its("name.size") { should eq(4) }
-          its("name.size.class") { should eq(Fixnum) }
+          if RUBY_VERSION >= "2.4.0"
+            its("name.size.class") { should eq(Integer) }
+          else
+            its("name.size.class") { should eq(Fixnum) }
+          end
 
           context "using should_not" do
             its("name") { should_not eq("Paul") }
@@ -86,7 +90,11 @@
           end
           its([:a]) { should eq("Symbol: a") }
           its(['a']) { should eq("String: a") }
-          its([:b, 'c', 4]) { should eq("Symbol: b; String: c; Fixnum: 4") }
+          if RUBY_VERSION >= "2.4.0"
+              its([:b, 'c', 4]) { should eq("Symbol: b; String: c; Integer: 4") }
+          else
+            its([:b, 'c', 4]) { should eq("Symbol: b; String: c; Fixnum: 4") }
+          end
           its(:name) { should eq("George") }
           context "when referring to an attribute that doesn't exist" do
             context "it raises an error" do