Sha256: 6ac0f082447d69ea9ed14c46ce0fc9a5cb5ce4d9ca55e7295f2f82ed90c7a281

Contents?: true

Size: 1.08 KB

Versions: 21

Compression:

Stored size: 1.08 KB

Contents

require_relative '../lib/depengine/processor/properties'

describe "the properties patcher" do

  it "should patch properties in a file by key/value" do
    test = Processor::Properties.new()
    test.properties_hash = { "webhost" => "www.sinnerschrader.com", "mailhost" => "mail.google.com" }
    test.assigner = "="
    test.patch("spec/properties/source/config.properties", "spec/properties/target/config.properties")


    File.open('spec/properties/target/config.properties').read.should include "webhost=www.sinnerschrader.com"

    FileUtils.rm_rf('spec/properties/target/config.properties')
  end

  it "should patch strings in file" do
    test = Processor::Properties.new()
    test.properties_hash = { "old_string" => "new_string", "even older string" => "" }
    test.substitute("spec/properties/source/random.rb", "spec/properties/target/random.rb")

    File.open('spec/properties/target/random.rb').read.should include "new_string"
    File.open('spec/properties/target/random.rb').read.should_not include "even older string"
    FileUtils.rm_rf('spec/properties/target/random.rb')
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
depengine-3.0.20 spec/properties_spec.rb
depengine-3.0.19 spec/properties_spec.rb
depengine-3.0.18 spec/properties_spec.rb
depengine-3.0.17 spec/properties_spec.rb
depengine-3.0.16 spec/properties_spec.rb
depengine-3.0.15 spec/properties_spec.rb
depengine-3.0.14 spec/properties_spec.rb
depengine-3.0.13 spec/properties_spec.rb
depengine-3.0.12 spec/properties_spec.rb
depengine-3.0.11 spec/properties_spec.rb
depengine-3.0.10 spec/properties_spec.rb
depengine-3.0.9 spec/properties_spec.rb
depengine-3.0.8 spec/properties_spec.rb
depengine-3.0.7 spec/properties_spec.rb
depengine-3.0.6 spec/properties_spec.rb
depengine-3.0.5 spec/properties_spec.rb
depengine-3.0.4 spec/properties_spec.rb
depengine-3.0.3 spec/properties_spec.rb
depengine-3.0.2 spec/properties_spec.rb
depengine-3.0.1 spec/properties_spec.rb