Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions core/string/modulo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@
("%d%% %s" % [10, "of chickens!"]).should == "10% of chickens!"
end

it "formats single % character at the end as literal %" do
("%" % []).should == "%"
("foo%" % []).should == "foo%"
ruby_version_is ""..."2.5" do
it "formats single % character at the end as literal %" do
("%" % []).should == "%"
("foo%" % []).should == "foo%"
end
end

ruby_version_is "2.5" do
it "raises an error if single % appears at the end" do
lambda { ("%" % []) }.should raise_error(ArgumentError)
lambda { ("foo%" % [])}.should raise_error(ArgumentError)
end
end

it "formats single % character before a newline as literal %" do
Expand Down