waterfoul/spec/mbc/rom_spec.rb

22 lines
476 B
Ruby
Raw Normal View History

2016-05-08 17:20:05 +10:00
require 'spec_helper'
describe Waterfoul::MBC::ROM do
let(:game_program) { Array.new 65_536, 0 }
subject { Waterfoul::MBC::ROM.new game_program }
2016-05-08 17:20:05 +10:00
describe '#[]' do
before { game_program[0x151] = 0x51 }
it 'reads byte at address from the game program' do
expect(subject[0x151]).to eq 0x51
2016-05-08 17:20:05 +10:00
end
end
describe '#[]=' do
it 'stores byte in external ram' do
subject[0xA001] = 0x8F
expect(subject.ram[0x1]).to eq 0x8F
2016-05-08 17:20:05 +10:00
end
end
end