Sha256: 777158d3ef515b5dee2356a3a0cac53a0949f8ac9ce4ddb4b725d1723412d7cf

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents


require 'test/unit'

require 'openwfe/def'
require 'openwfe/workitem'
require 'openwfe/engine/engine'
require 'openwfe/extras/participants/twitterparticipants'


class TwitterTest < Test::Unit::TestCase

  #def setup
  #end

  #def teardown
  #end

  #
  # tests

  #def xxxx_0
  def test_0

    tp = OpenWFE::Extras::TwitterParticipant.new(
      "openwferu", ENV['OWFE_TWITTER_PASSWORD'], :no_ssl => true)

    wi = OpenWFE::InFlowWorkItem.new
    wi.twitter_message = "from #{self.class.name} #{Time.now.to_s}"
    tp.consume(wi)

    wi.twitter_message = "from #{self.class.name} #{Time.now.to_s} personal"
    wi.twitter_target = "jmettraux"
    tp.consume(wi)

    assert true
  end

  class TwitterDef < OpenWFE::ProcessDefinition
    twitter
  end

  def test_1

    engine = OpenWFE::Engine.new

    tp = OpenWFE::Extras::TwitterParticipant.new(
      "openwferu", ENV['OWFE_TWITTER_PASSWORD'], :no_ssl => true)

    engine.register_participant "twitter", tp

    li = OpenWFE::LaunchItem.new TwitterDef
    # no twitter message

    fei = engine.launch li

    engine.wait_for fei

    assert true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruote-0.9.19 test/extras/twitter_test.rb