Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/test_character.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
binpath = File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'test/unit'
require 'character'
require 'stats'
require 'test_helper'


class TestCharacter < Test::Unit::TestCase
class TestCharacter < Minitest::Test
def setup
@ch = Character.new
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_combat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require 'require_file'
require 'hero'
require 'monster'
require 'minitest/autorun'
require 'io_interface'
require 'combat'
require 'test_helper'

class TestCombat < Minitest::Test
def setup
Expand Down
6 changes: 2 additions & 4 deletions test/test_cursor.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
binpath = File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'minitest/autorun'
require 'cursor'
require 'test/unit'
require 'test_helper'

class TestPosition < Test::Unit::TestCase
# Cursor are Positions -> row,column
class TestPosition < Minitest::Test
def setup; end

def test_next_up
Expand Down
3 changes: 3 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require 'minitest/reporters'
require 'minitest/autorun'
Minitest::Reporters.use!
4 changes: 2 additions & 2 deletions test/test_hero.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
binpath = File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'test/unit'
require 'hero'
require 'character'
require 'stats'
require 'weapon'
require 'consumable'
require 'test_helper'

class TestHero < Test::Unit::TestCase
class TestHero < Minitest::Test
def test_use_consumable
h = Hero.new
cons = Consumable.new
Expand Down
5 changes: 2 additions & 3 deletions test/test_map.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
binpath = File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'minitest/autorun'
require 'map'
require 'test/unit'
require 'position'
require 'test_helper'

# test for Map class
class TestMap < Test::Unit::TestCase
class TestMap < Minitest::Test
def test_create_custom_size
map = Map.new(5)
assert_equal 5, map.size
Expand Down
5 changes: 2 additions & 3 deletions test/test_map_generator.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
binpath = File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'minitest/autorun'
require 'random_map'
require 'custom_map'
require 'map_generator'
require 'hero'
require 'room'
require 'test/unit'
require 'test_helper'

class TestPosition < Test::Unit::TestCase
class TestPosition < Minitest::Test
def setup; end

def test_mapgenerator_create_map
Expand Down
4 changes: 2 additions & 2 deletions test/test_menu.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
binpath = File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'test/unit'
require 'menu'
require 'io_interface'
require 'test_helper'

class TestRandomCreator < Test::Unit::TestCase
class TestRandomCreator < Minitest::Test
def test_valid_input_array
device = IOinterface.new
def device.input
Expand Down
4 changes: 2 additions & 2 deletions test/test_monster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'stats'
require 'test/unit'
require 'monster'
require 'test_helper'

class TestMonster < Test::Unit::TestCase
class TestMonster < Minitest::Test
def test_escape_chance
m = Monster.new
assert_equal(m.escape_chance, 0)
Expand Down
4 changes: 2 additions & 2 deletions test/test_random_creator.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
binpath = File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'test/unit'
require 'random_creator'
require 'position'
require 'test_helper'

class TestRandomCreator < Test::Unit::TestCase
class TestRandomCreator < Minitest::Test
def setup
@difficulty1 = 1
@difficulty2 = 0
Expand Down
12 changes: 3 additions & 9 deletions test/test_room.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@
require 'io_terminal'
require 'item'
require 'wearable'

require 'room_factory'
require 'test_helper'

require 'test/unit'

class TestGameRoom < Test::Unit::TestCase
def setup; end
#-------------------------------------------------------------------
#RoomFactory

class TestGameRoom < Minitest::Test
def test_create_room
r = RoomFactory.create(:room)
assert_equal(Room, r.class, 'Wrong answer')
Expand Down Expand Up @@ -126,7 +120,7 @@ def device.input
rez = Hero.new.stats.attack + 10
assert_equal(rez, h.stats.attack, 'Attack not modified')
end

def test_shop_recalculate_supply
s = Shop.new(true, [Item.new, Item.new])
s.recalculate_supply(1)
Expand Down
4 changes: 2 additions & 2 deletions test/test_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
$LOAD_PATH.unshift File.expand_path(File.join(binpath, '..'))
require 'require_file'
require 'stats'
require 'test/unit'
require 'test_helper'

class TestStats < Test::Unit::TestCase
class TestStats < Minitest::Test
def test_initialization_with_hash
stats = Stats.new(attack: 5, defence: 7, hp: 9, coins: 11)
assert_equal [5, 7, 9, 11],
Expand Down