Sha256: 2250587ad1cb0a22a78e9dae74b7582f7bde7296c4511da9801f1ac6e28c28fa

Contents?: true

Size: 741 Bytes

Versions: 7

Compression:

Stored size: 741 Bytes

Contents

require File.expand_path('test_helper', File.dirname(__FILE__))

#fake package import
def android
  OpenStruct.new('util' => OpenStruct.new('Log' => nil))
end

class Log
  def self.v(*args)
    raise 'Log.v should be called with two arguments' if args.length != 2
  end

  def self.e(*args)
    raise 'Log.e should be called with two arguments' if args.length != 2
  end
end

class SampleBroadcastReceiverTest < Minitest::Test
  require 'assets/samples/sample_broadcast_receiver'

  def test_on_receive_calls_log_v
    context = {}
    intent = OpenStruct.new(:getExtras => '')
    SampleBroadcastReceiver.new.onReceive(context, intent)
  end

  def test_on_receive_calls_log_e
    SampleBroadcastReceiver.new.onReceive(nil, nil)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruboto-1.6.1 test/sample_broadcast_receiver_test.rb
ruboto-1.6.0 test/sample_broadcast_receiver_test.rb
ruboto-1.5.0 test/sample_broadcast_receiver_test.rb
ruboto-1.4.1 test/sample_broadcast_receiver_test.rb
ruboto-1.4.0 test/sample_broadcast_receiver_test.rb
ruboto-1.3.1 test/sample_broadcast_receiver_test.rb
ruboto-1.3.0 test/sample_broadcast_receiver_test.rb