spec/util/file_owner_spec.rb in wright-0.4.4 vs spec/util/file_owner_spec.rb in wright-0.5.0

- old
+ new

@@ -5,9 +5,28 @@ describe Wright::Util::FileOwner do before(:each) do @owner = Wright::Util::FileOwner.new end + describe '#initialize' do + it 'should accept user and group arguments' do + owner = Wright::Util::FileOwner.new('user') + owner.user.must_equal 'user' + + owner = Wright::Util::FileOwner.new('user', 'group') + owner.user.must_equal 'user' + owner.group.must_equal 'group' + + owner = Wright::Util::FileOwner.new('user:group') + owner.user.must_equal 'user' + owner.group.must_equal 'group' + + owner = Wright::Util::FileOwner.new('user:group1', 'group2') + owner.user.must_equal 'user' + owner.group.must_equal 'group2' + end + end + describe '#user_and_group=' do it 'should set the user' do @owner.group = 'group' @owner.user_and_group = 'user' @owner.user.must_equal 'user'