Sha256: 5cfa1fb32f113d1e5674ca9e42d6b9eb1f2e348f9c2efb93bbc6336fd6e7bd88
Contents?: true
Size: 1.34 KB
Versions: 2
Compression:
Stored size: 1.34 KB
Contents
require_relative 'test_helper' class SetTest < Minitest::Test def test_find_returns_one_set VCR.use_cassette('one_set') do set = MTG::Set.find('ktk') assert_equal 'KTK', set.code assert_equal 'Khans of Tarkir', set.name assert_equal 'expansion', set.type assert_equal 'black', set.border assert set.booster.any? {|rarity| rarity == 'common'} assert_equal '2014-09-26', set.release_date assert_equal 'ktk', set.magic_cards_info_code end end def test_find_with_invalid_code_throws_exception VCR.use_cassette('invalid_code') do assert_raises ArgumentError do MTG::Set.find('invalid') end end end def test_all_returns_all_sets VCR.use_cassette('all_sets') do sets = MTG::Set.all assert sets.length > 100 end end def test_all_with_filter_returns_sets VCR.use_cassette('all_sets_filtered') do sets = MTG::Set.where(name: 'khans').all set = sets[0] assert_equal 'KTK', set.code assert_equal 'Khans of Tarkir', set.name end end def test_generate_booster_returns_cards VCR.use_cassette('booster') do cards = MTG::Set.generate_booster('ktk') assert cards.length == 15 assert_equal 'KTK', cards.first.set end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mtg_sdk-3.2.0 | test/set_test.rb |
mtg_sdk-3.1.0 | test/set_test.rb |