Sha256: 3bae749430e678015f7f1662c8cf7e6642fda711d016c13624789ce74bb8c1e2

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

require 'test_helper'
require 'yaml'

class WwwEnbujyoTest < Test::Unit::TestCase
  context "WWW::Enbujyo instance" do
    setup do
      param = YAML.load_file("#{ENV['HOME']}/.enbujyorc")
      @agent = WWW::Enbujyo.new(
        :mail => param['mail'],
        :password => param['password']
      )
    end

    context "login method" do
      should "return true" do
        assert @agent.login
      end
    end

    context "player_user method" do
      should "return valid player hashdata" do
        @agent.login
        player = @agent.get_player_user
        assert player.name
        assert player.title
      end
    end

    context "get_selection_info method" do
      should "return valid game data" do
        @agent.login
        game = @agent.get_selection_info
        assert game.player0.is_a? WWW::Enbujyo::Player
        assert game.player1.is_a? WWW::Enbujyo::Player
        assert game.deck0.is_a? WWW::Enbujyo::Deck
        assert game.deck1.is_a? WWW::Enbujyo::Deck
        assert game.location0.is_a? WWW::Enbujyo::Location
        assert game.location1.is_a? WWW::Enbujyo::Location
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
holysugar-www-enbujyo-0.1.5 test/www-enbujyo_test.rb
holysugar-www-enbujyo-0.1.6 test/www-enbujyo_test.rb
holysugar-www-enbujyo-0.1.7 test/www-enbujyo_test.rb