require 'spec_helper'

module DVDConverter

  describe Subtitle do

    describe 'initialization' do
    
      before do
        @subtitle = Subtitle.new 1, '21', 'English', 'eng'
      end

      it 'stores the id' do
        @subtitle.track_id.should == 1
      end

      it 'stores the hex' do
        @subtitle.hex.should == '21'
      end

      it 'stores the language' do
        @subtitle.language.should == 'English'
      end

      it 'stores the code' do
        @subtitle.code.should == 'eng'
      end

    end

    describe 'printing' do

      it 'prints the detail of the track' do
        subtitle = Subtitle.new 1, '21', 'English', 'eng'
        subtitle.should_receive(:print).with('+ Subtitle Track 1: ')
        subtitle.should_receive(:print).with('21 - ')
        subtitle.should_receive(:print).with('English - ')
        subtitle.should_receive(:print).with("eng\n")

        subtitle.print_description
      end

    end

  end

end

