spec/analysis_spec.rb in ruby-echonest-0.4.0 vs spec/analysis_spec.rb in ruby-echonest-0.5.0

- old
+ new

@@ -5,78 +5,90 @@ describe Echonest::Analysis do before do @analysis = Echonest::Analysis.new(open(fixture('analysis.json')).read) end + it "should have artist" do + @analysis.artist.should eql("Philip Glass") + end + + it "should have album" do + @analysis.album.should eql("The Orange Mountain Music Philip Glass Sampler Vol.I") + end + + it "should have title" do + @analysis.title.should eql("Neverwas Restored (from Neverwas Soundtrack)") + end + it "should have beats" do beats = @analysis.beats - beats.size.should eql(324) - beats.first.start.should eql(0.27661) - beats.first.duration.should eql(0.36476) - beats.first.confidence.should eql(0.468) + beats.size.should eql(301) + beats.first.start.should eql(0.14982) + beats.first.duration.should eql(0.42958) + beats.first.confidence.should eql(0.0) end it "should have segments" do segments = @analysis.segments segment = segments.first - segments.size.should eql(274) + segments.size.should eql(339) segment.start.should eql(0.0) - segment.duration.should eql(0.43909) - segment.confidence.should eql(1.0) + segment.duration.should eql(0.10308) + segment.confidence.should eql(0.0) segment.loudness.time.should eql(0.0) segment.loudness.value.should eql(-60.0) - segment.max_loudness.time.should eql(0.11238) - segment.max_loudness.value.should eql(-33.563) + segment.max_loudness.time.should eql(0.07546) + segment.max_loudness.value.should eql(-57.86) segment.pitches.size.should eql(12) - segment.pitches.first.should eql(0.138) + segment.pitches.first.should eql(1.0) segment.timbre.size.should eql(12) - segment.timbre.first.should eql(11.525) + segment.timbre.first.should eql(1.178) end it "should have bars" do bars = @analysis.bars - bars.size.should eql(80) - bars.first.start.should eql(1.00704) - bars.first.duration.should eql(1.48532) - bars.first.confidence.should eql(0.188) + bars.size.should eql(75) + bars.first.start.should eql(0.14982) + bars.first.duration.should eql(1.7004) + bars.first.confidence.should eql(0.132) end it "should have tempo" do - @analysis.tempo.should eql(168.460) + @analysis.tempo.should eql(151.019) end it "should have sections" do sections = @analysis.sections section = sections.first sections.size.should eql(7) section.start.should eql(0.0) - section.duration.should eql(20.04271) + section.duration.should eql(21.14804) section.confidence.should eql(1.0) end it "should have durtion" do - @analysis.duration.should eql(120.68526) + @analysis.duration.should eql(120.68) end it "should have end of fade in" do - @analysis.end_of_fade_in.should eql(0.0) + @analysis.end_of_fade_in.should eql(0.10308) end it "should have start of fade out" do - @analysis.start_of_fade_out.should eql(113.557) + @analysis.start_of_fade_out.should eql(115.7863) end it "should have key" do @analysis.key.should eql(7) end it "should have loudness" do - @analysis.loudness.should eql(-19.140) + @analysis.loudness.should eql(-18.825) end it "should have mode" do @analysis.mode.should eql(1) end @@ -86,11 +98,11 @@ end it "should have tatums" do tatums = @analysis.tatums - tatums.size.should eql(648) - tatums.first.start.should eql(0.09469) - tatums.first.duration.should eql(0.18193) - tatums.first.confidence.should eql(0.286) + tatums.size.should eql(601) + tatums.first.start.should eql(0.14982) + tatums.first.duration.should eql(0.21743) + tatums.first.confidence.should eql(0.311) end end