Sha256: d5ba09aa8a3f3ec1625af160368c222ed092efa7dc0935790207e571b75b9cc3

Contents?: true

Size: 991 Bytes

Versions: 2

Compression:

Stored size: 991 Bytes

Contents

require 'spec_helper'

describe ComixScraper::Parser do

  context 'when it processes new releases' do

    before :each do

      f = File.open('spec/samples/new_releases.txt', 'r')
      new_releases = f.readline.split('\r\n')
  
      parser = ComixScraper::Parser.new
      @release_data = parser.parse(new_releases)
    end

    it 'it can find the shipping date' do
      @release_data.shipping_date.should == '5/30/2012'
    end

    it 'it can find the categories' do
      @release_data.categories.should   =~ ["COMICS", "DARK HORSE COMICS", "DC COMICS", "IDW PUBLISHING", "IMAGE COMICS", "MAGAZINES", "MARVEL COMICS", "MERCHANDISE"]            
    end

    it 'it can extract specific publication details' do
      @release_data.comix.each { | comic | puts comic.title }
      
      comic = ComixScraper::Comic.new('DARK HORSE COMICS', 'MAR120044', 'ANGEL & FAITH #10 REBEKAH ISAACS VAR CVR', '$2.99')
      @release_data.comix.include?(comic).should eql true
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
comix_scraper-1.0.0 spec/parser_spec.rb
comix_scraper-0.0.3 spec/parser_spec.rb