Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 64a8aad475
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (28 sloc) 0.782 kB
$:.unshift File.dirname(__FILE__)
require 'spec_helper'
require 'fileutils'
include FileUtils
describe Scissor::SoundFile do
before do
@mp3 = Scissor::SoundFile.new(fixture('sample.mp3'))
@wav = Scissor::SoundFile.new(fixture('sine.wav'))
end
after do
end
it "raise error if unknown file format" do
lambda {
Scissor::SoundFile.new(fixture('foo.bar'))
}.should raise_error(Scissor::SoundFile::UnknownFormat)
end
it "should get length" do
@mp3.length.should be_within(0.1).of(178.1)
@wav.length.should eql(1.0)
end
describe '#mono?' do
it "should return true if sound file is mono" do
@mp3.should be_mono
@wav.should_not be_mono
Scissor::SoundFile.new(fixture('mono.wav')).should be_mono
end
end
end
Jump to Line
Something went wrong with that request. Please try again.