Sha256: 0953f723477945e9c0328de3f09d1459bb5ec2069819ab5120df02263f992a9e

Contents?: true

Size: 945 Bytes

Versions: 9

Compression:

Stored size: 945 Bytes

Contents

require 'test_helper'

module Resources
  
  class UserTest < Test::Unit::TestCase
  
    context User do
    
      context "print_all" do
        
        should "warn if there are no users" do
          User.expects(:find).with(:all).returns([])
          User.expects(:warn).with("No users in project")
          User.print_all
        end
        
        should "print the users found with format" do
          user1 = stub("UserXml", :user => stub("User", :login => "user1", :name => "User One", :email => "user1@test"))
          user2 = stub("UserXml", :user => stub("User", :login => "user22", :name => "User TwoTwo", :email => "user22@test"))
          User.expects(:find).with(:all).returns([user1, user2])
          User.expects(:puts).with(" user1 -    User One -  user1@test")
          User.expects(:puts).with("user22 - User TwoTwo - user22@test")
          User.print_all
        end
      
      end
    
    end

  end
  
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
schubert-minglr-1.3.0 test/resources/user_test.rb
schubert-minglr-1.3.1 test/resources/user_test.rb
schubert-minglr-1.3.11 test/resources/user_test.rb
schubert-minglr-1.3.2 test/resources/user_test.rb
schubert-minglr-1.3.3 test/resources/user_test.rb
schubert-minglr-1.3.5 test/resources/user_test.rb
schubert-minglr-1.3.8 test/resources/user_test.rb
schubert-minglr-1.3.9 test/resources/user_test.rb
minglr-1.3.11 test/resources/user_test.rb