File: test_mechanize_file_saver.rb

package info (click to toggle)
ruby-mechanize 2.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,416 kB
  • sloc: ruby: 11,645; makefile: 7; sh: 4
file content (22 lines) | stat: -rw-r--r-- 369 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true
require 'mechanize/test_case'

class TestMechanizeFileSaver < Mechanize::TestCase

  def setup
    super

    @uri = URI 'http://example'
    @io = StringIO.new 'hello world'
  end

  def test_initialize
    in_tmpdir do
      Mechanize::FileSaver.new @uri, nil, @io, 200

      assert File.exist? 'example/index.html'
    end
  end

end