Class: AppDelegate

Inherits:
Object
  • Object
show all
Defined in:
app/app_delegate.rb

Instance Method Summary collapse

Instance Method Details

#application(application, didFinishLaunchingWithOptions: launchOptions) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/app_delegate.rb', line 6

def application(application, didFinishLaunchingWithOptions:launchOptions)
  puts ENV['hello world']

  expected = [
    ['string', "Sup dog"],
    ['int', 3],
    ['bool', false],
    ['hash', {:herp=>"derp"}],
    ['array', [1,2,3]],
    ['complex', [{:hello=>"world", :array=>[1, 2, 3]}, {:something=>:else}]]
  ]

  expected.each do |key, value|
    real_value = ENV[key]
    raise "Incorrect! Key: #{key} Expected: #{value} Actual: #{real_value}" if value != real_value
  end

  person = ENV['object']
  raise "Incorrect object unmarshal" if !person.is_a?(Person) || person.name != 'clay' || person.age != 3

  true
end