Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Bug fixes:
* Fix `Tempfile#{size,length}` when the IO is not flushed (#1765, @rafaelfranca).
* Dump and load instance variables in subclasses of `Exception` (#1766, @rafaelfranca).
* Fix `Date._iso8601` and `Date._rfc3339` when the string is an invalid date (#1773, @rafaelfranca).
* Match out of range ArgumentError message with MRI (#1774, @rafaelfranca)

Compatibility:

Expand Down
4 changes: 4 additions & 0 deletions spec/ruby/core/time/new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
it "raises ArgumentError if the utc_offset argument is greater than or equal to 10e9" do
-> { Time.new(2000, 1, 1, 0, 0, 0, 1000000000) }.should raise_error(ArgumentError)
end

it "raises ArgumentError if the month is greater than 12" do
-> { Time.new(2000, 16, 1, 0, 0, 0, "+01:00") }.should raise_error(ArgumentError, "argument out of range")
end
end

ruby_version_is "2.6" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public DynamicObject argumentErrorCantCompressNegativeNumbers(Node currentNode)
}

public DynamicObject argumentErrorOutOfRange(Node currentNode) {
return argumentError(coreStrings().OUT_OF_RANGE.getRope(), currentNode, null);
return argumentError(coreStrings().ARGUMENT_OUT_OF_RANGE.getRope(), currentNode, null);
}

public DynamicObject argumentErrorNegativeArraySize(Node currentNode) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/truffleruby/core/string/CoreStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class CoreStrings {
public final CoreString NEGATIVE_STRING_SIZE;
public final CoreString NIL;
public final CoreString ONE_HASH_REQUIRED;
public final CoreString OUT_OF_RANGE;
public final CoreString ARGUMENT_OUT_OF_RANGE;
public final CoreString PIPE;
public final CoreString PLUS;
public final CoreString POWER;
Expand Down Expand Up @@ -103,7 +103,7 @@ public CoreStrings(RubyContext context) {
NEGATIVE_STRING_SIZE = new CoreString(context, "negative string size (or size too big)");
NIL = new CoreString(context, "nil");
ONE_HASH_REQUIRED = new CoreString(context, "one hash required");
OUT_OF_RANGE = new CoreString(context, "out of range");
ARGUMENT_OUT_OF_RANGE = new CoreString(context, "argument out of range");
PIPE = new CoreString(context, "|");
PLUS = new CoreString(context, "+");
POWER = new CoreString(context, "**");
Expand Down