Skip to content

Commit

Permalink
Add total frames test
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmacphersonmusic committed May 16, 2015
1 parent 92bcb83 commit 1352767
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/music_theory/note.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
require 'music_theory/output'

module MusicTheory
Expand Down
13 changes: 13 additions & 0 deletions test/note_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'test_helper'

class TestNote < MiniTest::Test
def setup
@note_1 = MusicTheory::Note.new(frequency: 220, duration: 2.0)
end

def test_total_frames
sample_rate = 22050
frames = (2.0 * sample_rate).to_i
assert_equal frames, @note_1.total_frames
end
end

0 comments on commit 1352767

Please sign in to comment.