Sha256: 4bf25c4633fbcab6ecb2a159588291fffd3bfb0aa0a570db3c48ad544d673103

Contents?: true

Size: 1.46 KB

Versions: 8

Compression:

Stored size: 1.46 KB

Contents

require 'helper'

class TestBlitline < Test::Unit::TestCase

  should "raise exception if missing jobs" do
    assert_raises RuntimeError do
      blitline = Blitline.new
      blitline.post_jobs
    end
  end

  should "raise exception if job missing application id" do
    assert_raises RuntimeError do
      blitline = Blitline.new
      blitline.jobs << Blitline::Job.new("http://ww.foo.com")
      blitline.post_jobs
    end
  end

  should "raise exception if job missing image identifier" do
    assert_raises RuntimeError do
      blitline = Blitline.new
      job =  Blitline::Job.new("http://ww.foo.com")
      job.application_id = "foo"
      job.add_function("blue", nil)
      blitline.jobs << job
      blitline.post_jobs
    end
  end

  should "raise exception if job missing image identifier" do
    assert_raises RuntimeError do
      blitline = Blitline.new
      job =  Blitline::Job.new("http://ww.foo.com")
      job.application_id = "foo"
      job.add_function("blur", nil, "my_image")
      blitline.jobs << job
      blitline.post_jobs
    end
  end

  should "raise exception if job missing image identifier" do
    blitline = Blitline.new
    job =  Blitline::Job.new("http://ww.foo.com")
    job.add_function("blue", nil, "my_image")
    job.application_id = "foo"
    blitline.jobs << job
    results = blitline.post_jobs
    assert_not_nil results['results']
    assert_not_nil results['results'][0]
    assert_not_nil results['results'][0]['error']
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blitline-1.3.0 test/test_blitline.rb
blitline-1.2.3 test/test_blitline.rb
blitline-1.2.2 test/test_blitline.rb
blitline-1.2.0 test/test_blitline.rb
blitline-1.1.0 test/test_blitline.rb
blitline-1.0.3 test/test_blitline.rb
blitline-1.0.2 test/test_blitline.rb
blitline-1.0.1 test/test_blitline.rb