Sha256: e2b5e668c0b1782bec53a9907385d97c79a4b6878f5fa375217bfc2fc5ea6dd8

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

$:.unshift File.dirname(__FILE__)

require 'spec_helper'
require 'osx/cocoa'

include OSX
OSX.require_framework 'ScriptingBridge'

describe ITunesObserver do
  before do
    @itunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")
    raise 'iTunes should be running' unless @itunes.isRunning
    @result = nil
    @observer = ITunesObserver.new do |result|
      @result = result
    end

    @itunes.stop
  end

  after do
    @itunes.stop
  end

  it "should observe playing" do
    @itunes.playpause
    @observer.run(1)
    @result.should_not be_nil
    @result['Name'].should_not be_nil
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
youpy-itunes-observer-0.0.1 spec/itunes_observer_spec.rb