DEV: Fix linting issues

DEV: Fix linting issues

diff --git a/spec/lib/onebox/engine/imgur_onebox_spec.rb b/spec/lib/onebox/engine/imgur_onebox_spec.rb
index 6c40d95..6794d73 100644
--- a/spec/lib/onebox/engine/imgur_onebox_spec.rb
+++ b/spec/lib/onebox/engine/imgur_onebox_spec.rb
@@ -1,18 +1,18 @@
-# frozen_string_literal: true
-
-require "spec_helper"
-
-describe Onebox::Engine::ImgurOnebox do
-  let(:link) { "https://imgur.com/gallery/Sdc0Klc" }
-  let(:imgur) { described_class.new(link) }
-  let(:html) { imgur.to_html }
-
-  before do
-    fake(link, response("imgur"))
-  end
-
-  it "excludes html tags in title" do
-    allow(imgur).to receive(:is_album?) { true }
-    expect(html).to include("<span class='album-title'>[Album] Did you miss me?</span>")
-  end
-end
+# frozen_string_literal: true
+
+require "spec_helper"
+
+describe Onebox::Engine::ImgurOnebox do
+  let(:link) { "https://imgur.com/gallery/Sdc0Klc" }
+  let(:imgur) { described_class.new(link) }
+  let(:html) { imgur.to_html }
+
+  before do
+    fake(link, response("imgur"))
+  end
+
+  it "excludes html tags in title" do
+    allow(imgur).to receive(:is_album?).and_return(true)
+    expect(html).to include("<span class='album-title'>[Album] Did you miss me?</span>")
+  end
+end
diff --git a/spec/lib/onebox/engine/twitter_status_onebox_spec.rb b/spec/lib/onebox/engine/twitter_status_onebox_spec.rb
index cd7f5ac..bc6fca9 100644
--- a/spec/lib/onebox/engine/twitter_status_onebox_spec.rb
+++ b/spec/lib/onebox/engine/twitter_status_onebox_spec.rb
@@ -117,7 +117,7 @@ describe Onebox::Engine::TwitterStatusOnebox do
 
   context "with twitter client" do
     before(:each) do
-      @twitter_client = double(
+      @twitter_client = instance_double(
         "TwitterClient", status: api_response, prettify_tweet: tweet_content, twitter_credentials_missing?: false, prettify_number: favorite_count
       )
 
diff --git a/spec/lib/onebox/engine_spec.rb b/spec/lib/onebox/engine_spec.rb
index ef3b39f..6ed5ab0 100644
--- a/spec/lib/onebox/engine_spec.rb
+++ b/spec/lib/onebox/engine_spec.rb
@@ -20,7 +20,7 @@ describe Onebox::Engine do
   end
 
   describe "#link" do
-    before { allow(Onebox::View).to receive(:template) { %|this should be a template| } }
+    before { allow(Onebox::View).to receive(:template).and_return(%|this should be a template|) }
 
     it "escapes `link`" do
       html = OneboxEngineExample.new(%|http://foo.com/bar?a='&b=2|).to_html
diff --git a/spec/lib/onebox/matcher_spec.rb b/spec/lib/onebox/matcher_spec.rb
index 2132e8a..2905a8d 100644
--- a/spec/lib/onebox/matcher_spec.rb
+++ b/spec/lib/onebox/matcher_spec.rb
@@ -17,7 +17,7 @@ describe Onebox::Matcher do
       let(:matcher) { Onebox::Matcher.new(url) }
 
       it "finds an engine" do
-        allow(matcher).to receive(:ordered_engines) { [TestEngine] }
+        allow(matcher).to receive(:ordered_engines).and_return([TestEngine])
         expect(matcher.oneboxed).not_to be_nil
       end
     end
@@ -27,7 +27,7 @@ describe Onebox::Matcher do
       let(:matcher) { Onebox::Matcher.new(url) }
 
       it "doesn't find an engine" do
-        allow(matcher).to receive(:ordered_engines) { [TestEngine] }
+        allow(matcher).to receive(:ordered_engines).and_return([TestEngine])
         expect(matcher.oneboxed).not_to be_nil
       end
     end
@@ -37,7 +37,7 @@ describe Onebox::Matcher do
       let(:matcher) { Onebox::Matcher.new(url) }
 
       it "finds an engine" do
-        allow(matcher).to receive(:ordered_engines) { [TestEngine] }
+        allow(matcher).to receive(:ordered_engines).and_return([TestEngine])
         expect(matcher.oneboxed).not_to be_nil
       end
     end
@@ -47,7 +47,7 @@ describe Onebox::Matcher do
       let(:matcher) { Onebox::Matcher.new(url) }
 
       it "finds an engine" do
-        allow(matcher).to receive(:ordered_engines) { [TestEngine] }
+        allow(matcher).to receive(:ordered_engines).and_return([TestEngine])
         expect(matcher.oneboxed).not_to be_nil
       end
     end
@@ -56,7 +56,7 @@ describe Onebox::Matcher do
       %w{http://example.com https://example.com http://example.com:80 //example.com}.each do |url|
         it "finds an engine for '#{url}'" do
           matcher = Onebox::Matcher.new(url)
-          allow(matcher).to receive(:ordered_engines) { [TestEngine] }
+          allow(matcher).to receive(:ordered_engines).and_return([TestEngine])
           expect(matcher.oneboxed).not_to be_nil
         end
       end
@@ -66,7 +66,7 @@ describe Onebox::Matcher do
       %w{http://example.com:21 ftp://example.com}.each do |url|
         it "doesn't find an engine for '#{url}'" do
           matcher = Onebox::Matcher.new(url)
-          allow(matcher).to receive(:ordered_engines) { [TestEngine] }
+          allow(matcher).to receive(:ordered_engines).and_return([TestEngine])
           expect(matcher.oneboxed).to be_nil
         end
       end

GitHub sha: 62c58316