Sha256: 5e28789fcffbe9b4b4a542aa86c41a9fad9d4dabdb107c8d8bf63917ac75e9cb

Contents?: true

Size: 349 Bytes

Versions: 23

Compression:

Stored size: 349 Bytes

Contents

require_relative '../lib/text.rb'

describe Text do
	it "should be able to replace text in file" do
		FileUtils.mkdir('tmp') if(!File.exists?('tmp'))
		File.open('tmp/test.txt','w'){|f|
			f.write("test thing")
		}
		Text.replace_in_file('tmp/test.txt','thing','string')
		expect(IO.read('tmp/test.txt').include?('test string')).to eq(true)
	end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
dev_commands-0.0.17 spec/text_spec.rb
dev_commands-0.0.16 spec/text_spec.rb
dev_commands-0.0.15 spec/text_spec.rb