mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-04-28 20:55:35 +08:00
63 lines
1.7 KiB
Ruby
63 lines
1.7 KiB
Ruby
describe 'app' do
|
|
before do
|
|
@app = RubyMotionQuery::App
|
|
end
|
|
|
|
it 'should return App with rmq#app' do
|
|
rmq = RubyMotionQuery::RMQ.new
|
|
rmq.app.should == @app
|
|
end
|
|
|
|
it 'should return App with RMQ.app' do
|
|
RubyMotionQuery::RMQ.app.should == @app
|
|
end
|
|
|
|
it 'should return app window' do
|
|
@app.window.should == UIApplication.sharedApplication.keyWindow
|
|
end
|
|
|
|
it 'should return app delegate' do
|
|
@app.delegate.should == UIApplication.sharedApplication.delegate
|
|
end
|
|
|
|
it 'should return app version' do
|
|
@app.version.should == NSBundle.mainBundle.infoDictionary['CFBundleVersion']
|
|
end
|
|
|
|
it 'should return app name' do
|
|
@app.name.should == NSBundle.mainBundle.objectForInfoDictionaryKey('CFBundleDisplayName')
|
|
end
|
|
|
|
it 'should return app identifier' do
|
|
@app.identifier.should == NSBundle.mainBundle.bundleIdentifier
|
|
end
|
|
|
|
it 'should return app resource_path' do
|
|
@app.resource_path.should == NSBundle.mainBundle.resourcePath
|
|
end
|
|
|
|
it 'should return app document_path' do
|
|
@app.document_path.should == NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0]
|
|
end
|
|
|
|
|
|
describe 'environment' do
|
|
it 'should return environment as symbol, :test in this case' do
|
|
@app.environment.should == :test
|
|
end
|
|
|
|
it 'should return true if environment is test when test? is called' do
|
|
@app.test?.should == true
|
|
end
|
|
|
|
it 'should return false if environment is not development when development? is called' do
|
|
@app.development?.should == false
|
|
end
|
|
|
|
it 'should return false if environment is not release when release? or production? are called' do
|
|
@app.release?.should == false
|
|
@app.production?.should == false
|
|
end
|
|
end
|
|
end
|