mirror of https://github.com/tailix/libkernaux.git
Ruby: Add specs for KernAux::File
This commit is contained in:
parent
7897e79634
commit
064cfaf16e
|
@ -2,6 +2,7 @@
|
|||
|
||||
# rubocop:disable Lint/EmptyClass
|
||||
|
||||
if defined? KernAux::File
|
||||
module KernAux
|
||||
##
|
||||
# File simulator.
|
||||
|
@ -16,5 +17,6 @@ module KernAux
|
|||
# @!parse [ruby]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# rubocop:enable Lint/EmptyClass
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
defined? KernAux::File and RSpec.describe KernAux::File do
|
||||
subject(:our_file) { described_class.new method :out }
|
||||
|
||||
def out(str)
|
||||
(@buffer ||= +'') << String(str)
|
||||
end
|
||||
|
||||
specify do
|
||||
expect(our_file.instance_variable_get(:@out)).to eq method :out
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue