Sha256: 6dd7d76125d50984ae834e0a85466c60a6a9b446f5403a01511800a963d8849e

Contents?: true

Size: 581 Bytes

Versions: 5

Compression:

Stored size: 581 Bytes

Contents

require 'spec_helper'
require 'input_sanitizer/extended_converters/comma_joined_strings_converter'

describe InputSanitizer::CommaJoinedStringsConverter do
  let(:converter) { described_class.new }

  it "parses to array of ids" do
    converter.call("input,Sanitizer,ROCKS").should eq(["input", "Sanitizer", "ROCKS"])
  end

  it "allows underscores" do
    converter.call("input_sanitizer,rocks").should eq(["input_sanitizer", "rocks"])
  end

  it "raises on invalid character" do
    lambda { converter.call(":") }.should raise_error(InputSanitizer::ConversionError)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
input_sanitizer-0.6.0 spec/extended_converters/comma_joined_strings_converter_spec.rb
input_sanitizer-0.5.0 spec/extended_converters/comma_joined_strings_converter_spec.rb
input_sanitizer-0.4.1 spec/extended_converters/comma_joined_strings_converter_spec.rb
input_sanitizer-0.4.0 spec/extended_converters/comma_joined_strings_converter_spec.rb
input_sanitizer-0.3.33 spec/extended_converters/comma_joined_strings_converter_spec.rb