Sha256: 6dda547d7af909dec436c6771c23ae7a7ba89d0d1b48ac25792db753249c1193

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

require 'app-store-emigrant'
require 'helpers'
require 'minitest/spec'
require 'minitest/autorun'

include AppStore::Emigrant

describe App do
  
  LIBRARY = ROOT + '/fixtures/dummy-library'
  
  before do
    @dummy = App.new(LIBRARY + '/Dummy.ipa')
    @gta = App.new(LIBRARY + '/GTA.ipa')
    @soosiz = App.new(LIBRARY + '/Soosiz.ipa')
  end
  
  it 'must be a valid file on disk' do
    lambda do
      App.new(LIBRARY + '/Non-Existent.ipa')
    end.must_raise App::DoesNotExist
  end
  
  it 'must have a valid extension' do
    lambda do
      App.new(LIBRARY + '/Non-Existent.ipa')
    end.must_raise App::DoesNotExist
  end
  
  it 'can determine its own filename' do
    @gta.filename.must_equal 'GTA.ipa'
    @soosiz.filename.must_equal 'Soosiz.ipa'
  end
  
  it 'will report invalid structures' do
    @dummy.valid?.must_equal false
    @dummy.id.must_equal nil
    @dummy.version.must_equal nil
  end
  
  it 'can extract its name' do
    @gta.name.must_equal 'Grand Theft Auto: Chinatown Wars'
    @soosiz.name.must_equal 'Soosiz'
  end
  
  it 'can query local metadata' do
    @gta.version.must_equal '0.9'
    @soosiz.version.must_equal '1.1'
  end
  
  it 'can load cloud data' do
    @gta.cloudversion.must_equal '1.1.0'
    @soosiz.cloudversion.must_equal '1.3'
  end
  
  it 'can determine whether it is outdated' do
    @gta.outdated?.must_equal true
    @soosiz.outdated?.must_equal true
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
app-store-emigrant-0.0.7 specs/app.rb
app-store-emigrant-0.0.6 specs/app.rb
app-store-emigrant-0.0.5 specs/app.rb