Skip to content

Commit

Permalink
Improve frozen-string-literals compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
pat authored and leahneukirchen committed Jul 24, 2017
1 parent 5ab9cca commit 5e7115d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/bacon.rb
Expand Up @@ -11,7 +11,7 @@ module Bacon
VERSION = "1.2"

Counter = Hash.new(0)
ErrorLog = ""
ErrorLog = "".dup
Shared = Hash.new { |_, name|
raise NameError, "no such context: #{name.inspect}"
}
Expand Down Expand Up @@ -337,7 +337,7 @@ def satisfy(description="", &block)
def method_missing(name, *args, &block)
name = "#{name}?" if name.to_s =~ /\w[^?]\z/

desc = @negated ? "not " : ""
desc = @negated ? "not ".dup : "".dup
desc << @object.inspect << "." << name.to_s
desc << "(" << args.map{|x|x.inspect}.join(", ") << ") failed"

Expand Down
4 changes: 2 additions & 2 deletions test/spec_bacon.rb
Expand Up @@ -190,10 +190,10 @@ def equal_string(x)

it "should have should.be.identical_to/same_as" do
lambda { s = "string"; s.should.be.identical_to s }.should succeed
lambda { "string".should.be.identical_to "string" }.should fail
lambda { "string".should.be.identical_to "string".dup }.should fail

lambda { s = "string"; s.should.be.same_as s }.should succeed
lambda { "string".should.be.same_as "string" }.should fail
lambda { "string".should.be.same_as "string".dup }.should fail
end

it "should have should.respond_to" do
Expand Down

0 comments on commit 5e7115d

Please sign in to comment.