Sha256: 39730db39c194fa046217d2dd83517c2be7a55c6cde5da6d2a96b44d24c055d5

Contents?: true

Size: 838 Bytes

Versions: 8

Compression:

Stored size: 838 Bytes

Contents

require 'rubygems'
require 'test/unit'
require File.expand_path('../../lib/mini_magick', __FILE__)

class CommandBuilderTest < Test::Unit::TestCase
  include MiniMagick

  def test_basic
    c = CommandBuilder.new("test")
    c.resize "30x40"
    assert_equal "-resize \"30x40\"", c.args.join(" ")
  end

  def test_complicated
    c = CommandBuilder.new("test")
    c.resize "30x40"
    c.alpha 1, 3, 4
    c.resize "mome fingo"
    assert_equal "-resize \"30x40\" -alpha \"1 3 4\" -resize \"mome fingo\"", c.args.join(" ")
  end
  
  def test_valid_command
    begin
      c = CommandBuilder.new("test", "path")
      c.input 2
      assert false
    rescue NoMethodError
      assert true
    end
  end

  def test_dashed
    c = CommandBuilder.new("test")
    c.auto_orient
    assert_equal "-auto-orient", c.args.join(" ")
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
tupalo-mini_magick-3.2.2 test/command_builder_test.rb
tupalo-mini_magick-3.2 test/command_builder_test.rb
tupalo-mini_magick-3.1 test/command_builder_test.rb
mini_magick-3.1 test/command_builder_test.rb
mini_magick-3.0 test/command_builder_test.rb
mini_magick-2.3 test/command_builder_test.rb
mini_magick-2.1 test/command_builder_test.rb
mini_magick-2.0.2 test/command_builder_test.rb