Sha256: c1273a060b72a51c1607db08eeb4eae2cd71cb7db20606c97dacd25ba551c25b

Contents?: true

Size: 963 Bytes

Versions: 7

Compression:

Stored size: 963 Bytes

Contents

require File.dirname(__FILE__) + "/test_helper.rb"

class DreamyUserTest < Test::Unit::TestCase

  context "Creation" do
    setup do
      @xml = <<EOF
<data>
    <account_id>8675309</account_id>
    <disk_used_mb>123.04</disk_used_mb>
    <gecos>Joe Schmoe</gecos>
    <home>spork.Dreamy.com</home>
    <password>YahRight!</password>
    <quota_mb>50</quota_mb>
    <shell>/bin/bash</shell>
    <type>mail</type>
    <username>joe@schmoe.com</username>
</data>
EOF
    end

    should "create a new user from xml" do
      u = Dreamy::User.new_from_xml(Hpricot.XML(@xml))
      assert_equal 8675309, u.account_id
      assert_equal 123.04, u.disk_used_mb
      assert_equal "Joe Schmoe", u.gecos
      assert_equal "spork.Dreamy.com", u.home
      assert_equal "YahRight!", u.password
      assert_equal 50, u.quota_mb
      assert_equal "/bin/bash", u.shell
      assert_equal "mail", u.type
      assert_equal "joe@schmoe.com", u.username
    end
  end
  
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
jordan-brough-dreamy-0.5.1 test/user_test.rb
sant0sk1-dreamy-0.4.1 test/user_test.rb
sant0sk1-dreamy-0.5.0 test/user_test.rb
sant0sk1-dreamy-0.5.1 test/user_test.rb
dreamy-0.5.3 test/user_test.rb
dreamy-0.5.2 test/user_test.rb
dreamy-0.5.1 test/user_test.rb