Sha256: 979b4c3dad065190d4db9462371eccafbfbb340e82891a46f3be211c4ca502a4

Contents?: true

Size: 910 Bytes

Versions: 4

Compression:

Stored size: 910 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe DXRubyRP5::SoundEffect, '効果音を生成するクラス' do
  let(:sound_effect) {
    v = 80
    described_class.new(50, DXRubyRP5::WAVE_RECT, 1000) {
      v = v - 4 if v > 0
      [220, v]
    }
  }

  describe '.new' do
    it '呼び出すことができる' do
      expect { sound_effect }.not_to raise_error
    end
  end

  describe '#add' do
    it '呼び出すことができる' do
      expect {
        v = 80
        sound_effect.add(DXRubyRP5::WAVE_RECT, 1000) {
          v = v - 4 if v > 0
          [440, v]
        }
      }.not_to raise_error
    end
  end

  describe '#play' do
    it '呼び出すことができる' do
      expect { sound_effect.play }.not_to raise_error
    end
  end

  describe '#stop' do
    it '呼び出すことができる' do
      expect { sound_effect.stop }.not_to raise_error
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dxruby_rp5-0.0.4 spec/lib/dxruby_rp5/sound_effect_spec.rb
dxruby_rp5-0.0.3 spec/lib/dxruby_rp5/sound_effect_spec.rb
dxruby_rp5-0.0.2 spec/lib/dxruby_rp5/sound_effect_spec.rb
dxruby_rp5-0.0.1 spec/lib/dxruby_rp5/sound_effect_spec.rb