Sha256: 7df223becb278ff7c632c11d4f3963da7ec90235de10e5726c34b2d8620bab17

Contents?: true

Size: 278 Bytes

Versions: 26

Compression:

Stored size: 278 Bytes

Contents

describe "Numeric#magnitude" do
  it "returns self's absolute value" do
    (-100).magnitude.should == 100
    (100).magnitude.should == 100

    (-0).magnitude.should == 0
    (0).magnitude.should == 0

    (-42).magnitude.should == 42
    (42).magnitude.should == 42
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
opal-0.5.5 spec/opal/core/numeric/magnitude_spec.rb
opal-0.5.4 spec/corelib/numeric/magnitude_spec.rb
opal-0.5.2 spec/corelib/numeric/magnitude_spec.rb
opal-0.5.0 spec/corelib/numeric/magnitude_spec.rb
opal-0.4.4 spec/rubyspec/core/numeric/magnitude_spec.rb
opal-0.4.3 spec/rubyspec/core/numeric/magnitude_spec.rb
opal-0.4.2 spec/rubyspec/core/numeric/magnitude_spec.rb
opal-0.4.1 spec/rubyspec/core/numeric/magnitude_spec.rb
opal-0.4.0 spec/rubyspec/core/numeric/magnitude_spec.rb
opal-0.3.44 spec/rubyspec/core/numeric/magnitude_spec.rb
opal-0.3.43 spec/rubyspec/core/numeric/magnitude_spec.rb
opal-0.3.42 spec/core/numeric/magnitude_spec.rb
opal-0.3.41 spec/core/numeric/magnitude_spec.rb
opal-0.3.40 spec/core/numeric/magnitude_spec.rb
opal-0.3.39 spec/core/numeric/magnitude_spec.rb
opal-0.3.38 spec/core/numeric/magnitude_spec.rb
opal-0.3.37 spec/core/numeric/magnitude_spec.rb
opal-0.3.36 spec/core/numeric/magnitude_spec.rb
opal-0.3.35 spec/core/numeric/magnitude_spec.rb
opal-0.3.34 spec/core/numeric/magnitude_spec.rb