Sha256: d79c6b72f260b7c5164b728e09382b84e95c1270baff49e19fd3a00ff15ea78e

Contents?: true

Size: 1.42 KB

Versions: 17

Compression:

Stored size: 1.42 KB

Contents

require 'test_helper'

class FlixCloud::FileLocationsTest < Test::Unit::TestCase

  context "When validationg a file locations object with no attributes set" do
    setup do
      @file_locations = FlixCloud::FileLocations.new
      @file_locations.valid?
    end

    should "require input" do
      assert_match /input is required/, @file_locations.errors.to_s
    end

    should "require output" do
      assert_match /output is required/, @file_locations.errors.to_s
    end
  end

  context "When validating a file locations object with input, output, and watermark objects that are invalid" do
    setup do
      @file_locations = FlixCloud::FileLocations.new(:input => {}, :output => {}, :watermark => {})
      @file_locations.valid?
    end

    should "inherit the input object's errors" do
      assert @file_locations.errors.any?{|error|
        error.is_a?(Hash) && error[:input] && !error[:input].empty?
      }, "Did not inherit input object's errors"
    end

    should "inherit the output object's errors" do
      assert @file_locations.errors.any?{|error|
        error.is_a?(Hash) && error[:output] && !error[:output].empty?
      }, "Did not inherit output object's errors"
    end

    should "inherit the watermark object's errors" do
      assert @file_locations.errors.any?{|error|
        error.is_a?(Hash) && error[:watermark] && !error[:watermark].empty?
      }, "Did not inherit watermark object's errors"
    end
  end

end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
flixcloud-flix_cloud-gem-0.5.3 test/flix_cloud/file_locations_test.rb
flixcloud-flix_cloud-gem-0.5.4 test/flix_cloud/file_locations_test.rb
flixcloud-flix_cloud-gem-0.5.5 test/flix_cloud/file_locations_test.rb
spob-flix_cloud-gem-0.5.3 test/flix_cloud/file_locations_test.rb
spob-flix_cloud-gem-0.5.4 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.0.0 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.1.1 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.2.0 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.3.0 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.4.0 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.5.0 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.5.1 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.5.2 test/flix_cloud/file_locations_test.rb
zencoder-flix_cloud-gem-0.5.3 test/flix_cloud/file_locations_test.rb
spob-flix_cloud-gem-0.6.2 test/flix_cloud/file_locations_test.rb
spob-flix_cloud-gem-0.6.1 test/flix_cloud/file_locations_test.rb
spob-flix_cloud-gem-0.6 test/flix_cloud/file_locations_test.rb