Sha256: 5375c735b8a80422c2c1b0821179545f2bf04e24fffe83bdff5b863a5ebe8220

Contents?: true

Size: 753 Bytes

Versions: 19

Compression:

Stored size: 753 Bytes

Contents

require 'spec_helper'

describe String do
  describe "is_integer?" do
    it 'returns true if string is an integer and not 0' do
      expect("1".is_integer?).to eq true
    end
    it 'returns true if string is an integer and not 0' do
      expect("01".is_integer?).to eq true
    end
    it 'returns true if string is an integer and not 0' do
      expect("331299".is_integer?).to eq true
    end
    it 'returns true if string is an integer and not 0' do
      expect("000331299".is_integer?).to eq true
    end
    it 'returns false if string is not an integer or is 0' do
      expect("0".is_integer?).to eq false
    end
    it 'returns false if string is not an integer or is 0' do
      expect("yolo".is_integer?).to eq false
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ayadn-4.0.3 spec/unit/extend_spec.rb
ayadn-4.0.2 spec/unit/extend_spec.rb
ayadn-4.0.1 spec/unit/extend_spec.rb
ayadn-4.0 spec/unit/extend_spec.rb
ayadn-3.0 spec/unit/extend_spec.rb
ayadn-2.1 spec/unit/extend_spec.rb
ayadn-2.0.12 spec/unit/extend_spec.rb
ayadn-2.0.11 spec/unit/extend_spec.rb
ayadn-2.0.10 spec/unit/extend_spec.rb
ayadn-2.0.9 spec/unit/extend_spec.rb
ayadn-2.0.8 spec/unit/extend_spec.rb
ayadn-2.0.7 spec/unit/extend_spec.rb
ayadn-2.0.6 spec/unit/extend_spec.rb
ayadn-2.0.5 spec/unit/extend_spec.rb
ayadn-2.0.4 spec/unit/extend_spec.rb
ayadn-2.0.3 spec/unit/extend_spec.rb
ayadn-2.0.2 spec/unit/extend_spec.rb
ayadn-2.0.1 spec/unit/extend_spec.rb
ayadn-2.0 spec/unit/extend_spec.rb