Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b610805cd55e
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9ad27543c4fe
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Oct 21, 2016

  1. Copy the full SHA
    d7e7c94 View commit details
  2. Copy the full SHA
    3172130 View commit details
  3. Tag failing specs in truffle.

    headius committed Oct 21, 2016
    Copy the full SHA
    9ad2754 View commit details
10 changes: 6 additions & 4 deletions core/src/main/java/org/jruby/RubyComplex.java
Original file line number Diff line number Diff line change
@@ -82,6 +82,11 @@
@JRubyClass(name = "Complex", parent = "Numeric")
public class RubyComplex extends RubyNumeric {

private static final String[] UNDEFINED = new String[]{
"<", "<=", "<=>", ">", ">=", "between?", "divmod", "floor", "ceil", "modulo", "round", "step",
"truncate", "positive?", "negative?"
};

public static RubyClass createComplexClass(Ruby runtime) {
RubyClass complexc = runtime.defineClass("Complex", runtime.getNumeric(), COMPLEX_ALLOCATOR);
runtime.setComplex(complexc);
@@ -96,10 +101,7 @@ public static RubyClass createComplexClass(Ruby runtime) {
complexc.getSingletonClass().undefineMethod("allocate");
complexc.getSingletonClass().undefineMethod("new");

String[]undefined = {"<", "<=", "<=>", ">", ">=", "between?", "divmod",
"floor", "ceil", "modulo", "round", "step", "truncate"};

for (String undef : undefined) {
for (String undef : UNDEFINED) {
complexc.undefineMethod(undef);
}

11 changes: 11 additions & 0 deletions spec/ruby/core/complex/negative_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe "Complex#negative?" do
it "is undefined" do
c = Complex(1)

c.methods.should_not include(:negative?)

lambda {
c.negative?
}.should raise_error(NoMethodError)
end
end
11 changes: 11 additions & 0 deletions spec/ruby/core/complex/positive_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe "Complex#positive?" do
it "is undefined" do
c = Complex(1)

c.methods.should_not include(:positive?)

lambda {
c.positive?
}.should raise_error(NoMethodError)
end
end
1 change: 1 addition & 0 deletions spec/truffle/tags/core/complex/negative_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails:Complex#negative? is undefined
1 change: 1 addition & 0 deletions spec/truffle/tags/core/complex/positive_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails:Complex#positive? is undefined