Sha256: 4416cf1708bdd073e00d2a195211f4c586e705b2ab28dbf9809c1d79c402902b

Contents?: true

Size: 1014 Bytes

Versions: 1

Compression:

Stored size: 1014 Bytes

Contents

require 'spec_helper'
require 'ore/dependency'

describe Dependency do
  subject { Dependency }

  describe "parse" do
    it "should parse a dependency string with only a name" do
      dep = subject.parse('foo')

      dep.name.should == 'foo'
      dep.versions.should == ['>= 0']
    end

    it "should parse a dependency with a version" do
      dep = subject.parse('foo ~> 1.2.3')

      dep.name.should == 'foo'
      dep.versions.should == ['~> 1.2.3']
    end
  end

  describe "parse_versions" do
    it "should parse a single version" do
      dep = subject.parse_versions('foo', '~> 1.2.3')

      dep.versions.should == ['~> 1.2.3']
    end

    it "should parse multiple versions" do
      dep = subject.parse_versions('foo', '~> 1.2.3, >= 1.4.0')

      dep.versions.should =~ ['~> 1.2.3', '>= 1.4.0']
    end

    it "should parse an Array of versions" do
      dep = subject.parse_versions('foo', ['~> 1.2.3', '>= 1.4.0'])

      dep.versions.should =~ ['~> 1.2.3', '>= 1.4.0']
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ore-core-0.1.5 spec/dependency_spec.rb