Skip to content

Commit

Permalink
rename Medley::Notes to Medley::Note
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoertink committed Oct 21, 2016
1 parent 884e909 commit 61d515f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 51 deletions.
32 changes: 32 additions & 0 deletions spec/note_spec.cr
@@ -0,0 +1,32 @@
require "./spec_helper"

describe Medley::Note do

describe ".halfstep_up" do
it "returns G# when given G" do
note = Medley::Note.new("G")
note.halfstep_up.should eq "G#"
end

it "returns B# when given B" do
note = Medley::Note.new("B")
note.halfstep_up.should eq "B#"
end

it "returns D## when given D#" do
note = Medley::Note.new("D#")
note.halfstep_up.should eq "D##"
end

it "returns B when given Bb" do
note = Medley::Note.new("Bb")
note.halfstep_up.should eq "B"
end

it "returns F## when given E##" do
note = Medley::Note.new("E##")
note.halfstep_up.should eq "F##"
end
end

end
48 changes: 0 additions & 48 deletions spec/notes_spec.cr

This file was deleted.

2 changes: 1 addition & 1 deletion spec/spec_helper.cr
@@ -1,3 +1,3 @@
require "spec"
require "../src/medley"
require "../src/medley/notes"
require "../src/medley/note"
4 changes: 2 additions & 2 deletions src/medley/notes.cr → src/medley/note.cr
@@ -1,5 +1,5 @@
module Medley
class Notes
class Note
NOTE_NAMES = %w(A B C D E F G)
ALIASES = {"A##": "B", "B##": "C#", "C##": "D", "D##": "E",
"E##": "F#", "F##": "G", "G##": "A"}
Expand Down Expand Up @@ -64,7 +64,7 @@ module Medley
end

def wholestep_up
new_note = Medley::Notes.new(halfstep_up, @current_note)
new_note = Note.new(halfstep_up, @current_note)
new_note.halfstep_up
end
end
Expand Down

0 comments on commit 61d515f

Please sign in to comment.