Sha256: 673a15c310a58f91aa5ff831b974a673a6309dd52512052e2e4fb20976175cff

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 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 be_empty
    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

2 entries across 2 versions & 1 rubygems

Version Path
ore-core-0.1.2 spec/dependency_spec.rb
ore-core-0.1.1 spec/dependency_spec.rb