Sha256: a865b41172bf4b2d7d167a42d99e3b4857930ed91290f0c368192c2b47bf3b63

Contents?: true

Size: 505 Bytes

Versions: 15

Compression:

Stored size: 505 Bytes

Contents

# spec for field regexp conversion

require "spec_helper"

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

15 entries across 15 versions & 1 rubygems

Version Path
masticate-0.6.2 spec/lib/gsub_spec.rb
masticate-0.6.1 spec/lib/gsub_spec.rb
masticate-0.6.0 spec/lib/gsub_spec.rb
masticate-0.5.1 spec/lib/gsub_spec.rb
masticate-0.5.0 spec/lib/gsub_spec.rb
masticate-0.4.2 spec/lib/gsub_spec.rb
masticate-0.4.1 spec/lib/gsub_spec.rb
masticate-0.4.0 spec/lib/gsub_spec.rb
masticate-0.3.2 spec/lib/gsub_spec.rb
masticate-0.3.1 spec/lib/gsub_spec.rb
masticate-0.3 spec/lib/gsub_spec.rb
masticate-0.2.3 spec/lib/gsub_spec.rb
masticate-0.2.2 spec/lib/gsub_spec.rb
masticate-0.2.1 spec/lib/gsub_spec.rb
masticate-0.2 spec/lib/gsub_spec.rb