Sha256: fc203533d080b62965e7e1462674ad97c2ede6b7295de02bc9e2a0a80be9d2c7

Contents?: true

Size: 852 Bytes

Versions: 5

Compression:

Stored size: 852 Bytes

Contents

# frozen_string_literal: true

require_relative 'helper'

class ImpressionModuleTest < MiniTest::Test
  def test_resource_method
    r1 = Impression.resource do |req|
      req.respond('foobar', ':status' => Qeweney::Status::TEAPOT)
    end

    req = mock_req(':method' => 'GET', ':path' => '/')
    r1.route_and_call(req)
    assert_equal 'foobar', req.response_body
    assert_equal Qeweney::Status::TEAPOT, req.response_status
  end

  def test_file_tree_method
    r1 = Impression.file_tree(path: '/foo', directory: '/bar')

    assert_kind_of Impression::FileTree, r1
    assert_equal '/foo', r1.path
    assert_equal '/bar', r1.directory
  end

  def test_app_method
    r1 = Impression.app(path: '/foo', directory: '/bar')

    assert_kind_of Impression::App, r1
    assert_equal '/foo', r1.path
    assert_equal '/bar', r1.directory
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
impression-0.16 test/test_impression.rb
impression-0.15 test/test_impression.rb
impression-0.14 test/test_impression.rb
impression-0.13 test/test_impression.rb
impression-0.12 test/test_impression.rb