musical_spec 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a575ba2688860d3bc63cc531189e182f03232c10
4
+ data.tar.gz: 5e79b0c2477e34e4e9ef275e84322cc2649b9b31
5
+ SHA512:
6
+ metadata.gz: fd1d50386d1a78e1ee0ad789f6582f21c8378eab2cf94f309e3e741becc7d2ebb4a84fe541a36f0461ae3c8e77bf145bb337e7303232832c7b316225adb7a72b
7
+ data.tar.gz: 54e6e51ac8a6a0a3ca38447d91f0984e2589ca1156ce9acf43d863e404388efc8d210b5bb2fc8d9472f4adca2f2e988e82a5a49af38ecda56813aecc76a98bfe
@@ -1,3 +1,7 @@
1
+ ## 0.0.3 / 2015-10-23
2
+
3
+ * Requires RSpec 3+
4
+
1
5
  ## 0.0.2 / 2011-11-27
2
6
 
3
7
  * Formatter correctly will not go higher than the highest note now, instead of
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # musical_spec
2
2
 
3
- An RSpec formatter that plays higher notes as tests pass and lower notes as
4
- tests fail. A revelatory auditory experience! It's a subclass of the progress
5
- formatter, so you still get your pretty dots.
3
+ "A revelatory auditory experience!" - _Anonymous_
4
+
5
+ An RSpec 3 formatter that plays higher notes as tests pass and lower notes as
6
+ tests fail. It's a subclass of the progress formatter, so you still get your
7
+ pretty dots.
6
8
 
7
9
  ## Usage
8
10
 
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
- #!/usr/bin/env rake
2
1
  require "bundler/gem_tasks"
3
- require 'rspec/core/rake_task'
2
+ require "rspec/core/rake_task"
4
3
 
5
4
  RSpec::Core::RakeTask.new(:spec)
6
5
 
@@ -4,51 +4,49 @@ require 'rspec/core/formatters/progress_formatter'
4
4
 
5
5
  module MusicalSpec
6
6
  class Formatter < RSpec::Core::Formatters::ProgressFormatter
7
- def initialize(output)
7
+ RSpec::Core::Formatters.register self, :example_passed, :example_failed,
8
+ :example_pending
9
+
10
+ def initialize(output, note = nil)
8
11
  super(output)
9
- @note = Note.new
12
+ @note = Note.new(note)
10
13
  @player = Player.new
11
14
  end
12
15
 
13
16
  attr_reader :player
14
17
 
15
- # Plays a higher note and then calls super.
16
- def example_passed(example)
18
+ # Plays a higher note then print a progress dot
19
+ def example_passed(notification)
17
20
  play_higher_note
18
- super(example)
21
+ super
19
22
  end
20
23
 
21
- # Plays a lower note and then calls super.
22
- def example_failed(example)
24
+ # Plays a lower note then print a progress dot
25
+ def example_failed(notification)
23
26
  play_lower_note
24
- super(example)
27
+ super
25
28
  end
26
29
 
27
- # Plays a note without changing the pitch and then calls super.
28
- def example_pending(example)
30
+ # Plays a note without changing the pitch then print a progress dot
31
+ def example_pending(notification)
29
32
  play_note
30
- super(example)
33
+ super
31
34
  end
32
35
 
33
36
  private
34
37
 
35
38
  def play_note
36
- @player.play(note)
39
+ @player.play(@note)
37
40
  end
38
41
 
39
42
  def play_higher_note
40
- @note.next!
43
+ @note.higher!
41
44
  play_note
42
45
  end
43
46
 
44
47
  def play_lower_note
45
- @note.prev!
48
+ @note.lower!
46
49
  play_note
47
50
  end
48
-
49
-
50
- def note
51
- @note.note
52
- end
53
51
  end
54
52
  end
@@ -7,15 +7,9 @@ module MusicalSpec
7
7
 
8
8
  # Takes 1 optional argument, a note string like "C4".
9
9
  def initialize(desired_note_string = nil)
10
- if desired_note_string.nil?
11
- self.note = LOWEST_NOTE.to_s
12
- else
13
- self.note = desired_note_string
14
- end
10
+ self.note = desired_note_string || LOWEST_NOTE.to_s
15
11
  end
16
12
 
17
- attr_reader :letter, :octave
18
-
19
13
  # A string like "C4".
20
14
  def to_s
21
15
  "#{letter}#{octave}"
@@ -32,42 +26,50 @@ module MusicalSpec
32
26
 
33
27
  # Increase the pitch, handling octave changes. Will not go above
34
28
  # MusicalSpec::HIGHEST_NOTE.
35
- def next!
36
- if self != HIGHEST_NOTE
37
- if @letter == 'B'
38
- @letter = 'C'
29
+ def higher!
30
+ if below_highest_note?
31
+ if @letter == SCALE_PROGRESSION.last
32
+ @letter = SCALE_PROGRESSION.first
39
33
  @octave += 1
40
- elsif @letter == 'G'
41
- @letter = 'A'
42
34
  else
43
- @letter.next!
35
+ @letter = SCALE_PROGRESSION[SCALE_PROGRESSION.index(@letter) + 1]
44
36
  end
45
37
  end
46
38
  end
47
39
 
48
40
  # Decrease the pitch, handling octave changes. Will not go below
49
41
  # MusicalSpec::LOWEST_NOTE.
50
- def prev!
51
- if self != LOWEST_NOTE
52
- if @letter == 'C'
53
- @letter = 'B'
42
+ def lower!
43
+ if above_lowest_note?
44
+ if @letter == SCALE_PROGRESSION.first
45
+ @letter = SCALE_PROGRESSION.last
54
46
  @octave -= 1
55
- elsif @letter == 'A'
56
- @letter = 'G'
57
47
  else
58
- @letter = (@letter.ord - 1).chr
48
+ @letter = SCALE_PROGRESSION[SCALE_PROGRESSION.index(@letter) - 1]
59
49
  end
60
50
  end
61
51
  end
62
52
 
53
+ protected
54
+
55
+ attr_reader :letter, :octave
56
+
63
57
  def <=>(other_note)
64
- other_letter = other_note.letter
65
- other_octave = other_note.octave
66
- if octave == other_octave
67
- SCALE_PROGRESSION.index(letter) <=> SCALE_PROGRESSION.index(other_letter)
58
+ if octave == other_note.octave
59
+ SCALE_PROGRESSION.index(letter) <=> SCALE_PROGRESSION.index(other_note.letter)
68
60
  else
69
- octave <=> other_octave
61
+ octave <=> other_note.octave
70
62
  end
71
63
  end
64
+
65
+ private
66
+
67
+ def below_highest_note?
68
+ self < HIGHEST_NOTE
69
+ end
70
+
71
+ def above_lowest_note?
72
+ self > LOWEST_NOTE
73
+ end
72
74
  end
73
75
  end
@@ -7,10 +7,10 @@ module MusicalSpec
7
7
  ONE_TRUE_BLOOPSAPHONE.tempo = 320
8
8
  end
9
9
 
10
- # Takes a note string like "C4".
10
+ # Takes a Note instance.
11
11
  def play(note)
12
12
  ONE_TRUE_BLOOPSAPHONE.clear
13
- ONE_TRUE_BLOOPSAPHONE.tune(@sound, note)
13
+ ONE_TRUE_BLOOPSAPHONE.tune(@sound, note.to_s)
14
14
  ONE_TRUE_BLOOPSAPHONE.play
15
15
  sleep 0.01 while ! ONE_TRUE_BLOOPSAPHONE.stopped?
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module MusicalSpec
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/musical_spec.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ["gabe@thoughtbot.com"]
7
7
  gem.description = %q{A musical formatter for RSpec.}
8
8
  gem.summary = %q{A musical formatter for RSpec. The sound gets lower as failures pile up, and higher when tests pass.}
9
- gem.homepage = "" # FIXME
9
+ gem.homepage = "https://github.com/gabebw/musical_spec"
10
10
 
11
11
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
12
  gem.files = `git ls-files`.split("\n")
@@ -16,8 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.version = MusicalSpec::VERSION
17
17
 
18
18
  gem.add_dependency('bloopsaphone', '~> 0.4')
19
- gem.add_dependency('rspec-core', '~> 2.0')
19
+ gem.add_dependency('rspec-core', '~> 3.0')
20
20
 
21
- gem.add_development_dependency('rspec', '~> 2.0')
22
- gem.add_development_dependency('bourne', '~> 1.0')
21
+ gem.add_development_dependency('rspec', '~> 3.0')
23
22
  end
@@ -2,25 +2,51 @@ require 'spec_helper'
2
2
  require 'stringio'
3
3
 
4
4
  describe MusicalSpec::Formatter do
5
- before { subject.player.stubs(:play) }
5
+ it 'is a ProgressFormatter' do
6
+ formatter = MusicalSpec::Formatter.new('C4')
7
+ expect(formatter).to be_a RSpec::Core::Formatters::ProgressFormatter
8
+ end
9
+
10
+ it 'tells RSpec that it can handle passed/failed/pending specs' do
11
+ registered_formatters = RSpec::Core::Formatters::Loader.formatters
6
12
 
7
- it { should be_a RSpec::Core::Formatters::ProgressFormatter }
13
+ expect(registered_formatters[MusicalSpec::Formatter]).to eq [
14
+ :example_passed,
15
+ :example_failed,
16
+ :example_pending
17
+ ]
18
+ end
8
19
 
9
20
  it 'plays a higher-pitched sound when an example passes' do
10
- subject.example_passed(example)
11
- subject.player.should have_received(:play).with('D4')
21
+ formatter = formatter_with_note('E4')
22
+ formatter.example_passed(example)
23
+ expect(formatter.player).to have_played('F4').once
12
24
  end
13
25
 
14
26
  it 'plays a lower-pitched sound when an example fails' do
15
- subject.example_failed(example)
16
- subject.player.should have_received(:play).with('B3')
27
+ formatter = formatter_with_note('E4')
28
+ formatter.example_failed(example)
29
+ expect(formatter.player).to have_played('D4').once
17
30
  end
18
31
 
19
32
  it 'does not change the note when an example is pending' do
20
- subject.example_pending(example)
21
- subject.player.should have_received(:play).with('C4')
33
+ formatter = formatter_with_note('E4')
34
+ formatter.example_pending(example)
35
+ expect(formatter.player).to have_played('E4').once
36
+ end
37
+
38
+ def formatter_with_note(note)
39
+ MusicalSpec::Formatter.new(StringIO.new, note).tap do |formatter|
40
+ allow(formatter.player).to receive(:play)
41
+ end
42
+ end
43
+
44
+ def have_played(note_string)
45
+ note = MusicalSpec::Note.new(note_string)
46
+ have_received(:play).with(note)
22
47
  end
23
48
 
24
- subject { MusicalSpec::Formatter.new(StringIO.new) }
25
- let(:example){ RSpec::Core::ExampleGroup.describe.example }
49
+ def example
50
+ RSpec::Core::ExampleGroup.describe.example
51
+ end
26
52
  end
@@ -2,97 +2,97 @@ require 'spec_helper'
2
2
 
3
3
  describe MusicalSpec::Note do
4
4
  it 'defaults to the lowest note' do
5
- subject.to_s.should == MusicalSpec::LOWEST_NOTE.to_s
5
+ expect(subject.to_s).to eq(MusicalSpec::LOWEST_NOTE.to_s)
6
6
  end
7
7
 
8
8
  it 'can be initialized with a note' do
9
- MusicalSpec::Note.new('E4').to_s.should == 'E4'
9
+ expect(MusicalSpec::Note.new('E4').to_s).to eq('E4')
10
10
  end
11
11
 
12
12
  it 'does not go higher than B6' do
13
13
  subject.note = 'B6'
14
- subject.next!
15
- subject.to_s.should == 'B6'
14
+ subject.higher!
15
+ expect(subject.to_s).to eq('B6')
16
16
  end
17
17
 
18
18
  it 'does not go lower than C2' do
19
19
  subject.note = 'C2'
20
- subject.prev!
21
- subject.to_s.should == 'C2'
20
+ subject.lower!
21
+ expect(subject.to_s).to eq('C2')
22
22
  end
23
23
 
24
24
  it 'allows setting the note' do
25
25
  subject.note = 'A4'
26
- subject.to_s.should == 'A4'
26
+ expect(subject.to_s).to eq('A4')
27
27
  end
28
28
 
29
- context '#next!' do
29
+ context '#higher!' do
30
30
  it 'increases the note by 1' do
31
31
  subject.note = 'C4'
32
- subject.next!
33
- subject.to_s.should == 'D4'
32
+ subject.higher!
33
+ expect(subject.to_s).to eq('D4')
34
34
  end
35
35
 
36
36
  it 'changes octaves when moving from B to C' do
37
37
  subject.note = 'B4'
38
- subject.next!
39
- subject.to_s.should == 'C5'
38
+ subject.higher!
39
+ expect(subject.to_s).to eq('C5')
40
40
  end
41
41
 
42
42
  it 'does not change octaves when moving from G to A' do
43
43
  subject.note = 'G4'
44
- subject.next!
45
- subject.to_s.should == 'A4'
44
+ subject.higher!
45
+ expect(subject.to_s).to eq('A4')
46
46
  end
47
47
  end
48
48
 
49
- context '#prev!' do
49
+ context '#lower!' do
50
50
  it 'decreases the note by 1' do
51
51
  subject.note = 'E4'
52
- subject.prev!
53
- subject.to_s.should == 'D4'
52
+ subject.lower!
53
+ expect(subject.to_s).to eq('D4')
54
54
  end
55
55
 
56
56
  it 'changes octaves when moving from C to B' do
57
57
  subject.note = 'C4'
58
- subject.prev!
59
- subject.to_s.should == 'B3'
58
+ subject.lower!
59
+ expect(subject.to_s).to eq('B3')
60
60
  end
61
61
 
62
62
  it 'does not change octaves when moving from A to G' do
63
63
  subject.note = 'A4'
64
- subject.prev!
65
- subject.to_s.should == 'G4'
64
+ subject.lower!
65
+ expect(subject.to_s).to eq('G4')
66
66
  end
67
67
  end
68
68
 
69
69
  context '<=>' do
70
70
  it 'knows that D4 < E4' do
71
- d4.should be < e4
71
+ expect(d4).to be < e4
72
72
  end
73
73
 
74
74
  it 'knows that E4 > D4' do
75
- e4.should be > d4
75
+ expect(e4).to be > d4
76
76
  end
77
77
 
78
78
  it 'knows that C4 > B3' do
79
- c4.should be > b3
79
+ expect(c4).to be > b3
80
80
  end
81
81
 
82
82
  it 'knows that B3 < C4' do
83
- b3.should be < c4
83
+ expect(b3).to be < c4
84
84
  end
85
85
 
86
86
  it 'knows that A4 > G4' do
87
- a4.should be > g4
87
+ expect(a4).to be > g4
88
88
  end
89
89
 
90
90
  it 'knows that A4 == A4' do
91
- a4.should == a4
91
+ expect(a4).to eq(a4)
92
92
  end
93
93
 
94
94
  it 'knows that G4 < A4' do
95
- g4.should be < a4
95
+ expect(g4).to be < a4
96
96
  end
97
97
 
98
98
  let(:d4) { MusicalSpec::Note.new('D4') }
@@ -1,36 +1,56 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe MusicalSpec::Player do
4
- before do
5
- @real_bloopsaphone = MusicalSpec::ONE_TRUE_BLOOPSAPHONE
6
- MusicalSpec::ONE_TRUE_BLOOPSAPHONE = fake_bloopsaphone
7
- end
8
-
9
- after { MusicalSpec::ONE_TRUE_BLOOPSAPHONE = @real_bloopsaphone }
10
-
11
4
  it 'sets the correct note' do
12
- subject.play('C4')
13
- fake_bloopsaphone.should have_received(:tune).with(fake_sound, 'C4')
5
+ bloopsaphone_mock = build_bloopsaphone_mock
6
+ sound = bloopsaphone_mock.sound
7
+ with_one_true_bloopsaphone(bloopsaphone_mock) do
8
+ subject.play(MusicalSpec::Note.new('C4'))
9
+ expect(bloopsaphone_mock).to have_received(:tune).with(sound, 'C4')
10
+ end
14
11
  end
15
12
 
16
13
  it 'clears tunes before playing' do
17
- subject.play('C4')
18
- fake_bloopsaphone.should have_received(:clear).once
14
+ bloopsaphone_mock = build_bloopsaphone_mock
15
+ with_one_true_bloopsaphone(bloopsaphone_mock) do
16
+ subject.play(MusicalSpec::Note.new('C4'))
17
+ expect(bloopsaphone_mock).to have_received(:clear).once
18
+ end
19
19
  end
20
20
 
21
21
  it 'plays the tune' do
22
- subject.play('C4')
23
- fake_bloopsaphone.should have_received(:play).once
22
+ bloopsaphone_mock = build_bloopsaphone_mock
23
+ with_one_true_bloopsaphone(bloopsaphone_mock) do
24
+ subject.play(MusicalSpec::Note.new('C4'))
25
+ expect(bloopsaphone_mock).to have_received(:play).once
26
+ end
27
+ end
28
+
29
+ def fake_sound
30
+ double("Bloopsaphone sound", "sustain=" => nil)
31
+ end
32
+
33
+ def build_bloopsaphone_mock
34
+ double(
35
+ 'Fake Bloopsaphone',
36
+ :tune => nil,
37
+ :tempo= => nil,
38
+ :play => nil,
39
+ :clear => nil,
40
+ :stopped? => true,
41
+ :sound => fake_sound,
42
+ )
24
43
  end
25
44
 
26
- let(:fake_sound) { stub("Bloopsaphone sound", :sustain= => nil) }
27
- let(:fake_bloopsaphone) do
28
- stub('Fake Bloopsaphone',
29
- :tune => nil,
30
- :tempo= => nil,
31
- :play => nil,
32
- :clear => nil,
33
- :stopped? => true,
34
- :sound => fake_sound)
45
+ def with_one_true_bloopsaphone(new_bloopsaphone)
46
+ real_bloopsaphone = MusicalSpec::ONE_TRUE_BLOOPSAPHONE
47
+ MusicalSpec.send(:remove_const, :ONE_TRUE_BLOOPSAPHONE)
48
+ MusicalSpec.const_set(:ONE_TRUE_BLOOPSAPHONE, new_bloopsaphone)
49
+ begin
50
+ yield
51
+ ensure
52
+ MusicalSpec.send(:remove_const, :ONE_TRUE_BLOOPSAPHONE)
53
+ MusicalSpec.const_set(:ONE_TRUE_BLOOPSAPHONE, real_bloopsaphone)
54
+ end
35
55
  end
36
56
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe MusicalSpec do
4
- it "creates a Bloopsaphone singleton because of thread wackiness" do
5
- MusicalSpec::ONE_TRUE_BLOOPSAPHONE.should be_a Bloops
3
+ describe MusicalSpec::ONE_TRUE_BLOOPSAPHONE do
4
+ it "is a Bloopsaphone singleton because of thread wackiness" do
5
+ expect(MusicalSpec::ONE_TRUE_BLOOPSAPHONE).to be_a Bloops
6
6
  end
7
7
  end
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  $LOAD_PATH << File.expand_path('../lib', __FILE__)
2
2
 
3
3
  require 'rspec'
4
- require 'bourne'
5
-
6
4
  require 'musical_spec'
7
5
 
8
6
  RSpec.configure do |config|
9
- config.mock_with :mocha
7
+ config.mock_with :rspec
8
+ config.expect_with :rspec do |c|
9
+ c.syntax = :expect
10
+ end
10
11
  end
metadata CHANGED
@@ -1,60 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musical_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gabe Berke-Williams
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-11-27 00:00:00.000000000Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bloopsaphone
16
- requirement: &2153575200 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0.4'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *2153575200
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.4'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rspec-core
27
- requirement: &2153574000 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ~>
31
+ - - "~>"
31
32
  - !ruby/object:Gem::Version
32
- version: '2.0'
33
+ version: '3.0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *2153574000
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rspec
38
- requirement: &2153573280 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ~>
45
+ - - "~>"
42
46
  - !ruby/object:Gem::Version
43
- version: '2.0'
47
+ version: '3.0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *2153573280
47
- - !ruby/object:Gem::Dependency
48
- name: bourne
49
- requirement: &2153572800 !ruby/object:Gem::Requirement
50
- none: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
55
- type: :development
56
- prerelease: false
57
- version_requirements: *2153572800
54
+ version: '3.0'
58
55
  description: A musical formatter for RSpec.
59
56
  email:
60
57
  - gabe@thoughtbot.com
@@ -62,13 +59,12 @@ executables: []
62
59
  extensions: []
63
60
  extra_rdoc_files: []
64
61
  files:
65
- - .gitignore
66
- - Changelog.md
62
+ - ".gitignore"
67
63
  - Gemfile
64
+ - NEWS.md
68
65
  - README.md
69
66
  - Rakefile
70
67
  - lib/musical_spec.rb
71
- - lib/musical_spec/bloops.rb
72
68
  - lib/musical_spec/formatter.rb
73
69
  - lib/musical_spec/note.rb
74
70
  - lib/musical_spec/player.rb
@@ -79,29 +75,28 @@ files:
79
75
  - spec/musical_spec/player_spec.rb
80
76
  - spec/musical_spec_spec.rb
81
77
  - spec/spec_helper.rb
82
- homepage: ''
78
+ homepage: https://github.com/gabebw/musical_spec
83
79
  licenses: []
80
+ metadata: {}
84
81
  post_install_message:
85
82
  rdoc_options: []
86
83
  require_paths:
87
84
  - lib
88
85
  required_ruby_version: !ruby/object:Gem::Requirement
89
- none: false
90
86
  requirements:
91
- - - ! '>='
87
+ - - ">="
92
88
  - !ruby/object:Gem::Version
93
89
  version: '0'
94
90
  required_rubygems_version: !ruby/object:Gem::Requirement
95
- none: false
96
91
  requirements:
97
- - - ! '>='
92
+ - - ">="
98
93
  - !ruby/object:Gem::Version
99
94
  version: '0'
100
95
  requirements: []
101
96
  rubyforge_project:
102
- rubygems_version: 1.8.11
97
+ rubygems_version: 2.4.5.1
103
98
  signing_key:
104
- specification_version: 3
99
+ specification_version: 4
105
100
  summary: A musical formatter for RSpec. The sound gets lower as failures pile up,
106
101
  and higher when tests pass.
107
102
  test_files:
@@ -110,4 +105,3 @@ test_files:
110
105
  - spec/musical_spec/player_spec.rb
111
106
  - spec/musical_spec_spec.rb
112
107
  - spec/spec_helper.rb
113
- has_rdoc:
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ruby
2
- class SoundPlayer
3
- def initialize
4
- @bloopsaphone = Bloops.new
5
- @sound = @bloopsaphone.sound(Bloops::SQUARE)
6
- @sound.sustain = 1
7
-
8
- @note = Note.new
9
- end
10
-
11
- def start
12
- 200.times do
13
- @bloopsaphone.clear
14
- if success?
15
- @note.next!
16
- else
17
- @note.next!
18
- # @note.prev!
19
- end
20
-
21
- @bloopsaphone.tune(@sound, @note.note)
22
- @bloopsaphone.play
23
- sleep 0.1 #while !@bloopsaphone.stopped?
24
- end
25
- end
26
-
27
- private
28
-
29
- def success?
30
- rand(2) == 0
31
- end
32
- end
33
-
34
-
35
- player = SoundPlayer.new
36
- player.start