File: fix-rspec-deprecated-syntax.patch

package info (click to toggle)
ruby-gravtastic 3.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 172 kB
  • sloc: ruby: 154; makefile: 3
file content (100 lines) | stat: -rw-r--r-- 3,777 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Description: Replace RSpec syntax "should" with "expect"
 `:should` syntax without explicitly enabling the syntax is deprecated in
 RSpec. This patch will replace `:should` syntax with `#expect`, which
 introduced in RSpec 2.11.
 .
 Could not forward because upstream project repository is read-only.
Author: Jongmin Kim <jmkim@pukyong.ac.kr>
Last-Update: 2019-05-18
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Gemfile
+++ b/Gemfile
@@ -1,2 +1,2 @@
-gem 'rspec'
+gem 'rspec', '>= 2.11'
 gem 'rr'
--- a/Rakefile
+++ b/Rakefile
@@ -18,7 +18,7 @@
 end
 CLEAN.add 'pkg'
 
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
 RSpec::Core::RakeTask.new do |t|
   t.rspec_opts = ['--color', '--require ./spec/helper']
 end
--- a/spec/gravtastic_spec.rb
+++ b/spec/gravtastic_spec.rb
@@ -10,7 +10,7 @@
   describe ".is_gravtastic" do
 
     it "includes the methods" do
-      @g.included_modules.should include(Gravtastic::InstanceMethods)
+      expect(@g.included_modules).to include(Gravtastic::InstanceMethods)
     end
 
   end
@@ -18,11 +18,11 @@
   describe 'default' do
 
     it "options are {:rating => 'PG', :secure => false, :filetype => :png}" do
-      @g.gravatar_defaults.should == {:rating => 'PG', :secure => false, :filetype => :png}
+      expect(@g.gravatar_defaults).to eq( {:rating => 'PG', :secure => false, :filetype => :png} )
     end
 
     it "source is :email" do
-      @g.gravatar_source.should == :email
+      expect(@g.gravatar_source).to eq(:email)
     end
 
   end
@@ -34,7 +34,7 @@
       stub(a).email do 'USER@EXAMPLE.COM' end
       b = @g.new
       stub(b).email do 'user@example.com' end
-      a.gravatar_id.should == b.gravatar_id
+      expect(a.gravatar_id).to eq(b.gravatar_id)
     end
 
   end
@@ -47,30 +47,30 @@
     end
 
     it "makes a pretty URL" do
-      @user.gravatar_url.should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=PG'
+      expect(@user.gravatar_url).to eq('http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=PG')
     end
 
     it "makes a secure URL" do
-      @user.gravatar_url(:secure => true).should == 'https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=PG'
+      expect(@user.gravatar_url(:secure => true)).to eq('https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=PG')
     end
 
     it "makes a jpeggy URL" do
-      @user.gravatar_url(:filetype => :jpg).should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.jpg?r=PG'
+      expect(@user.gravatar_url(:filetype => :jpg)).to eq('http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.jpg?r=PG')
     end
 
     it "makes a saucy URL" do
-      @user.gravatar_url(:rating => 'R').should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R'
+      expect(@user.gravatar_url(:rating => 'R')).to eq('http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R')
     end
 
     it "abides to some new fancy feature" do
-      @user.gravatar_url(:extreme => true).should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?extreme=true&r=PG'
+      expect(@user.gravatar_url(:extreme => true)).to eq('http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?extreme=true&r=PG')
     end
 
     it "makes a URL from the defaults" do
       stub(@user.class).gravatar_defaults{ {:size => 20, :rating => 'R18', :secure => true, :filetype => :png} }
-      @user.gravatar_url.should == 'https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R18&s=20'
+      expect(@user.gravatar_url).to eq('https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R18&s=20')
     end
 
   end
 
-end
\ No newline at end of file
+end