Sha256: c13ba641dbac6ce8b5e5112f1c912357db464480bead2340ecef10149dc3a9cb

Contents?: true

Size: 789 Bytes

Versions: 11

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

require 'json'
require 'yaml'

require 'helpers/curlyq-helpers'
require 'test_helper'

# Tests for tags command
class CurlyQImagesTest < Test::Unit::TestCase
  include CurlyQHelpers

  def test_images_query
    result = curlyq('images', '-t', 'img', '-q', '[alt$=screenshot]', 'https://brettterpstra.com/2024/01/08/keyboard-maestro-giveaway/')
    json = JSON.parse(result)

    assert(json.count == 1, 'Should have found 1 image')
    assert_match(/Keyboard Maestro screenshot/, json[0]['alt'], 'Should match Keyboard Meastro screenshot')
  end

  def test_images_type
    result = curlyq('images', '-t', 'srcset', 'https://brettterpstra.com/')
    json = JSON.parse(result)

    assert(json.count.positive?, 'Should have found at least 1 image')
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
curlyq-0.0.16 test/curlyq_images_test.rb
curlyq-0.0.15 test/curlyq_images_test.rb
curlyq-0.0.14 test/curlyq_images_test.rb
curlyq-0.0.13 test/curlyq_images_test.rb
curlyq-0.0.12 test/curlyq_images_test.rb
curlyq-0.0.11 test/curlyq_images_test.rb
curlyq-0.0.10 test/curlyq_images_test.rb
curlyq-0.0.9 test/curlyq_images_test.rb
curlyq-0.0.8 test/curlyq_images_test.rb
curlyq-0.0.7 test/curlyq_images_test.rb
curlyq-0.0.6 test/curlyq_images_test.rb