Skip to content

Commit

Permalink
Unxit xitted specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dodecaphonic committed Mar 17, 2014
1 parent e595a0f commit bca956d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 49 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: ruby
rvm:
- 2.0.0
- 2.1.1
- jruby-head
before_install:
- sudo apt-get update && sudo apt-get install -y lame sox libsox-fmt-mp3 zip

Expand Down
15 changes: 12 additions & 3 deletions spec/balladina/mixdown_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@

it "joins a set of Tracks into a zipfile" do
zipped_path = subject.perform_on("track-1" => clips, "track-2" => clips)
expect(File.size(zipped_path)).to eq(File.size(mixdown))
expect(contents_of(zipped_path)).to eq(contents_of(mixdown, :mixdown))
end

def digest(path)
Digest::MD5.file path
def contents_of(zipfile, type = :reference)
dest = destination_of(zipfile, type)
FileUtils.mkdir_p dest
`unzip #{zipfile} -d #{dest}`
Dir["dest/**/*"]
ensure
FileUtils.rm_rf destination_of(zipfile, type)
end

def destination_of(zipfile, type)
File.join(tmp_mixdowns, "unzipping-#{type}")
end
end
1 change: 1 addition & 0 deletions spec/balladina/track_coordinator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
end

xit do
pending "figure out how to write this and get what I mean"
@coordinator.control_recording "start_recording"
end
end
Expand Down
75 changes: 30 additions & 45 deletions spec/balladina/track_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@

describe Balladina::Track, actor_system: :global do
let(:socket) { double("socket") }
let(:creates_recorders) { double("Recorder") }

class MockRecorder
include Celluloid

def record
@recording = true
end

def recording?
@recording
end
end

class MockRecorderWithDeathBuiltin
include Celluloid

def initialize(*args); end

def record
sleep 0.1
raise "hell"
end
end

before do
@track = Balladina::Track.new("test-track", socket,
Expand All @@ -37,36 +13,20 @@ def record
end

describe "when recording" do
describe "and starting" do
before do
@recorder = MockRecorder.new
creates_recorders.should_receive(:new_link).with(@track, socket)
.and_return @recorder
end
let(:creates_recorders) { MockRecorder }

after do
@recorder.terminate
end

xit "changes state to 'recording'" do
describe "and starting" do
it "changes state to 'recording'" do
expect(@track).not_to be_recording
@track.start_recording
expect(@track).to be_recording
expect(@recorder).to be_recording
end
end

describe "and stopping deliberately" do
before do
@recorder = MockRecorder.new
creates_recorders.should_receive(:new_link).with(@track, socket)
.and_return @recorder
end

xit "changes state" do
it "changes state" do
@track.start_recording
expect(@track).to be_recording
expect(@recorder).to be_recording
@track.stop_recording
expect(@track).not_to be_recording
end
Expand All @@ -75,12 +35,37 @@ def record
describe "and stopping because Recorder died" do
let(:creates_recorders) { MockRecorderWithDeathBuiltin }

xit "changes its state" do
it "changes its state" do
@track.start_recording
expect(@track).to be_recording
sleep 0.2
expect(@track).not_to be_recording
end
end
end

class MockRecorder
include Celluloid

def initialize(*args); end

def record
@recording = true
end

def recording?
@recording
end
end

class MockRecorderWithDeathBuiltin
include Celluloid

def initialize(*args); end

def record
sleep 0.1
raise "hell"
end
end
end

0 comments on commit bca956d

Please sign in to comment.