Sha256: 41d04141c78bea6a38a5e56bbaa6be473bf2a62fd8071b989c9c4f4dab8be0fa

Contents?: true

Size: 493 Bytes

Versions: 18

Compression:

Stored size: 493 Bytes

Contents

require 'spec_helper'

describe 'Numeric#neg?' do
  it 'returns false for positive integer' do
    expect(1.neg?).to be_falsey
  end

  it 'returns false for positive float' do
    expect(0.1.neg?).to be_falsey
  end

  it 'returns true for negative integer' do
    expect(-1.neg?).to be_truthy
  end

  it 'returns true for negative float' do
    expect(-0.01.neg?).to be_truthy
  end

  it 'returns false for 0' do
    expect(0.neg?).to be_falsey
    expect(0.0.neg?).to be_falsey
  end
end

Version data entries

18 entries across 15 versions & 5 rubygems

Version Path
powerpack-0.1.3 spec/powerpack/numeric/neg_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/numeric/neg_spec.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/numeric/neg_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/numeric/neg_spec.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.2/spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/powerpack-0.1.2/spec/powerpack/numeric/neg_spec.rb
powerpack-0.1.2 spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/powerpack-0.1.1/spec/powerpack/numeric/neg_spec.rb
powerpack-0.1.1 spec/powerpack/numeric/neg_spec.rb