class Cucumberator::FeatureFile
Public Class Methods
new(scenario)
click to toggle source
# File lib/cucumberator/feature_file.rb, line 3 def initialize(scenario) @scenario = scenario end
Public Instance Methods
append(contents)
click to toggle source
# File lib/cucumberator/feature_file.rb, line 23 def append(contents) File.open(file, 'a') { |f| f.puts(contents) } end
file()
click to toggle source
# File lib/cucumberator/feature_file.rb, line 11 def file @feature_file ||= Pathname.new(@scenario.file_colon_line.split(":").first).realpath end
lines()
click to toggle source
# File lib/cucumberator/feature_file.rb, line 7 def lines File.readlines(file) end
overwrite(contents)
click to toggle source
# File lib/cucumberator/feature_file.rb, line 19 def overwrite(contents) File.open(file, 'w') { |f| f.puts(contents) } end
to_s()
click to toggle source
# File lib/cucumberator/feature_file.rb, line 15 def to_s File.basename(file) end