Sha256: 3edddadb1664c271de10e8ceb32a9d48dc8a118e34403c505f0369627716db60

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe GuitarProParser do
  it 'should has a version' do
    GuitarProParser::VERSION.should_not be_nil
  end

  shared_examples 'all Guitar Pro versions' do
    it 'is a song object' do
      subject.should be_kind_of GuitarProParser::Song
    end

    its(:title) { should == 'Song Title'}
    its('tracks.count') { should == 10 }
  end

  shared_examples 'file with headers only' do
    it 'has no data about notes' do
      subject.tracks.each do |track|
        track.bars.should be_empty
      end
    end
  end


  describe '.read_file' do
    context 'Guitar Pro 5' do
      subject { GuitarProParser.read_file(test_tab_path(5)) }
      it_behaves_like 'all Guitar Pro versions'
    end

    context 'Guitar Pro 4' do
      subject { GuitarProParser.read_file(test_tab_path(4)) }
      it_behaves_like 'all Guitar Pro versions'
    end
  end

  describe '.read_headers' do
    context 'Header only Guitar Pro 5' do
      subject { GuitarProParser.read_headers(test_tab_path(5)) }
      it_behaves_like 'all Guitar Pro versions'
      it_behaves_like 'file with headers only'
    end

    context 'Header only Guitar Pro 4' do
      subject { GuitarProParser.read_headers(test_tab_path(4)) }
      it_behaves_like 'all Guitar Pro versions'
      it_behaves_like 'file with headers only'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
guitar_pro_parser-0.0.4 spec/lib/guitar_pro_parser_spec.rb
guitar_pro_parser-0.0.3 spec/lib/guitar_pro_parser_spec.rb
guitar_pro_parser-0.0.2 spec/lib/guitar_pro_parser_spec.rb
guitar_pro_parser-0.0.1 spec/lib/guitar_pro_parser_spec.rb