Class: RSpec::Given::FileCache

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/given/file_cache.rb

Instance Method Summary collapse

Constructor Details

#initializeFileCache

Returns a new instance of FileCache.



4
5
6
# File 'lib/rspec/given/file_cache.rb', line 4

def initialize
  @lines = {}
end

Instance Method Details

#get(file_name) ⇒ Object



8
9
10
# File 'lib/rspec/given/file_cache.rb', line 8

def get(file_name)
  @lines[file_name] ||= read_lines(file_name)
end