specs/app.rb in app-store-emigrant-0.0.4 vs specs/app.rb in app-store-emigrant-0.0.5
- old
+ new
@@ -9,11 +9,12 @@
LIBRARY = ROOT + '/fixtures/dummy-library'
before do
@dummy = App.new(LIBRARY + '/Dummy.ipa')
- @outdated = App.new(LIBRARY + '/Outdated.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')
@@ -25,27 +26,36 @@
App.new(LIBRARY + '/Non-Existent.ipa')
end.must_raise App::DoesNotExist
end
it 'can determine its own filename' do
- @dummy.filename.must_equal 'Dummy.ipa'
+ @gta.filename.must_equal 'GTA.ipa'
+ @soosiz.filename.must_equal 'Soosiz.ipa'
end
- it 'can handle invalid structures' do
- lambda do
- @dummy.version
- end.must_raise App::Invalid
+ 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
- @outdated.version.must_equal '0.9'
+ @gta.version.must_equal '0.9'
+ @soosiz.version.must_equal '1.1'
end
- it 'can query clouddata' do
- @outdated.cloudversion.must_equal '1.1.0'
+ 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
- @outdated.outdated?.must_equal true
+ @gta.outdated?.must_equal true
+ @soosiz.outdated?.must_equal true
end
end