From 50f82f51874babe92cbb808013647a7989d54354 Mon Sep 17 00:00:00 2001 From: Serdar Dogruyol Date: Fri, 26 Jan 2018 18:35:34 +0300 Subject: [PATCH] Use be_nil in specs instead of eq nil --- spec/context_spec.cr | 4 ++-- spec/static_file_handler_spec.cr | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/context_spec.cr b/spec/context_spec.cr index 6c5f36a..c972926 100644 --- a/spec/context_spec.cr +++ b/spec/context_spec.cr @@ -100,8 +100,8 @@ describe "Context" do Kemal::FilterHandler::INSTANCE.call(context) Kemal::RouteHandler::INSTANCE.call(context) - context.get?("non_existent_key").should eq nil - context.get?("another_non_existent_key").should eq nil + context.get?("non_existent_key").should be_nil + context.get?("another_non_existent_key").should be_nil end end end diff --git a/spec/static_file_handler_spec.cr b/spec/static_file_handler_spec.cr index 4ce1b73..6a29227 100644 --- a/spec/static_file_handler_spec.cr +++ b/spec/static_file_handler_spec.cr @@ -61,7 +61,7 @@ describe Kemal::StaticFileHandler do headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"} response = handle HTTP::Request.new("GET", "/dir/test.txt", headers) response.status_code.should eq(200) - response.headers["Content-Encoding"]?.should eq nil + response.headers["Content-Encoding"]?.should be_nil end it "should not gzip a file if config is false, headers accept gzip and file is > 880 bytes" do @@ -69,7 +69,7 @@ describe Kemal::StaticFileHandler do headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"} response = handle HTTP::Request.new("GET", "/dir/bigger.txt", headers) response.status_code.should eq(200) - response.headers["Content-Encoding"]?.should eq nil + response.headers["Content-Encoding"]?.should be_nil end it "should not serve a not found file" do @@ -117,7 +117,7 @@ describe Kemal::StaticFileHandler do if response.status_code == 206 response.headers.has_key?("Content-Range").should eq true match = response.headers["Content-Range"].match(/bytes (\d+)-(\d+)\/(\d+)/) - match.should_not eq nil + match.should_not be_nil if match start_range = match[1].to_i { 0 } end_range = match[2].to_i { 0 }