Sha256: b90ffb9e94efb01c53af7e30c41472ae5b923bff8ddd09fe2f88e13aa9ef8141

Contents?: true

Size: 1.04 KB

Versions: 13

Compression:

Stored size: 1.04 KB

Contents

require 'timewizard/utils/wizardry'

RSpec.describe 'Timewizard::Utils::Wizardry' do
  context '.only_version' do
    it 'should raise an error when arg is nil' do
      expect { Timewizard::Utils::Wizardry.only_version nil }.to raise_error('stringy cannot be null')
    end

    it 'should return the same value when given a proper version number' do
      base = '0.0.1'

      expected = '0.0.1'
      actual = Timewizard::Utils::Wizardry.only_version base

      expect(actual).to eq(expected)
    end

    it 'should return a version number when given a text string containing a version number' do
      base = 'this is version 0.0.1'

      expected = '0.0.1'
      actual = Timewizard::Utils::Wizardry.only_version base

      expect(actual).to eq(expected)
    end

    it 'should return a version number when version number is in the middle of the string' do
      base = 'this, 0.0.1, is the version being test'

      expected = '0.0.1'
      actual = Timewizard::Utils::Wizardry.only_version base

      expect(actual).to eq(expected)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
timewizard-0.3.2.pre.alpha.pre.82 spec/utils/wizardry_spec.rb
timewizard-0.3.4.pre.alpha.pre.78 spec/utils/wizardry_spec.rb
timewizard-0.3.4.pre.alpha.pre.77 spec/utils/wizardry_spec.rb
timewizard-0.3.3 spec/utils/wizardry_spec.rb
timewizard-0.3.2.pre.alpha.pre.73 spec/utils/wizardry_spec.rb
timewizard-0.3.2 spec/utils/wizardry_spec.rb
timewizard-0.3.1 spec/utils/wizardry_spec.rb
timewizard-0.3.1.pre.alpha.pre.64 spec/utils/wizardry_spec.rb
timewizard-0.3.0.pre.alpha.pre.60 spec/utils/wizardry_spec.rb
timewizard-0.3.1.pre.alpha.pre.61 spec/utils/wizardry_spec.rb
timewizard-0.3.0.pre.alpha.pre.59 spec/utils/wizardry_spec.rb
timewizard-0.3.0.pre.alpha.pre.58 spec/utils/wizardry_spec.rb
timewizard-0.3.0.pre.alpha.pre.57 spec/utils/wizardry_spec.rb