Sha256: 387f6f6b97ce91a781683c30730f01eaea9a605f0e9856e875f58b4b4a4e4be6

Contents?: true

Size: 524 Bytes

Versions: 5

Compression:

Stored size: 524 Bytes

Contents

# spec for field regexp conversion

require "spec_helper"
require "tempfile"

describe "gsubbing" do
  it "should apply conversion to a single column" do
    filename = File.dirname(__FILE__) + "/../data/badnums.csv"
    tmp = Tempfile.new('gsubber')
    results = Masticate.gsub(filename, :output => tmp, :field => 'AuditByID', :from => '/,|(.00$)/', :to => '')
    output = File.read(tmp)
    correct_output = File.read(File.dirname(__FILE__) + "/../data/badnums_fixed.csv")

    output.should == correct_output
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
masticate-0.1.5 spec/lib/gsub_spec.rb
masticate-0.1.4 spec/lib/gsub_spec.rb
masticate-0.1.3 spec/lib/gsub_spec.rb
masticate-0.1.1 spec/lib/gsub_spec.rb
masticate-0.1.0 spec/lib/gsub_spec.rb