Sha256: 8a83b0df6163d8a21ad1a3daea09d7a8b25f64d47b5e66745e5fd52b42a76a05

Contents?: true

Size: 510 Bytes

Versions: 1

Compression:

Stored size: 510 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)

		FileUtils.cp('spec/sln-vs12-example/csharp-library/csharp-library.cs','tmp/csharp-library.cs')
		Text.replace_in_file('tmp/csharp-library.cs','Test','Test2')
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dev_commands-0.0.56 spec/text_spec.rb