Module: Spotify::Mock

Included in:
Spotify
Defined in:
lib/mockspotify.rb,
lib/mockspotify/version.rb

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pathString

Returns path to the libmockspotify C extension binary.

Returns:

  • (String)

    path to the libmockspotify C extension binary.



8
9
10
# File 'lib/mockspotify.rb', line 8

def self.path
  File.expand_path('../../ext/libmockspotify.', __FILE__) << Config::MAKEFILE_CONFIG['DLEXT']
end

Instance Method Details

#attach_functionObject

Overriden to not throw an error on missing functions.



18
19
20
21
22
# File 'lib/mockspotify.rb', line 18

def attach_function(*)
  super
rescue FFI::NotFoundError => e
  warn "#{e.message}" if $VERBOSE
end

#ffi_libObject

Overridden to always ffi_lib the mock path.



13
14
15
# File 'lib/mockspotify.rb', line 13

def ffi_lib(*)
  super(Mock.path)
end