You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2010/02/28 18:32:30 UTC
svn commit: r917215 - /buildr/trunk/spec/packaging/artifact_namespace_spec.rb
Author: boisvert
Date: Sun Feb 28 17:32:30 2010
New Revision: 917215
URL: http://svn.apache.org/viewvc?rev=917215&view=rev
Log:
Add more specs for artifact_ns and ArtifactRequirement in context of BUILDR-233
Modified:
buildr/trunk/spec/packaging/artifact_namespace_spec.rb
Modified: buildr/trunk/spec/packaging/artifact_namespace_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/packaging/artifact_namespace_spec.rb?rev=917215&r1=917214&r2=917215&view=diff
==============================================================================
--- buildr/trunk/spec/packaging/artifact_namespace_spec.rb (original)
+++ buildr/trunk/spec/packaging/artifact_namespace_spec.rb Sun Feb 28 17:32:30 2010
@@ -36,11 +36,11 @@
Buildr::ArtifactNamespace.root { |ns| flag = true; ns.should be_root }
flag.should == true
end
-
+
it 'should return the root when used outside of a project definition' do
artifact_ns.should be_root
end
-
+
it 'should yield to a block when used outside of a project definition' do
flag = false
artifact_ns {|ns| flag = true; ns.should be_root}
@@ -301,6 +301,14 @@
end
end
+ it 'should handle version string' do
+ foo = artifact_ns do |ns|
+ ns.bar = 'a:b:c:1'
+ end
+ foo.use :bar => '2.0'
+ foo.bar.version.should == '2.0'
+ end
+
end
describe '#values' do
@@ -517,6 +525,23 @@
end # ArtifactNamespace
+describe Buildr::ArtifactNamespace do
+ it 'should be created from artifact_ns' do
+ foo = artifact_ns do |ns|
+ ns.bar = 'a:b:jar:1.0'
+ end
+ foo.bar.should be_kind_of(ArtifactNamespace::ArtifactRequirement)
+ end
+
+ it 'should handle version as string' do
+ foo = artifact_ns do |ns|
+ ns.bar = 'a:b:jar:1.0'
+ end
+ foo.bar.version = '2.0'
+ foo.bar.version.should == '2.0'
+ end
+end # ArtifactRequirement
+
describe Buildr do
before(:each) { Buildr::ArtifactNamespace.clear }