Sha256: 425f13648937eba66c352fb44020697b711bc3a2a8c00ee8ff17de0e9abc01ff

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 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

2 entries across 2 versions & 1 rubygems

Version Path
dev_commands-0.0.58 spec/text_spec.rb
dev_commands-0.0.57 spec/text_spec.rb