Sha256: c15f42108a908c02bc7b71c7d083cc2f8211b24c15f2c887fd00ab29d7629f6e

Contents?: true

Size: 527 Bytes

Versions: 33

Compression:

Stored size: 527 Bytes

Contents

require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper")

describe "Sequel::Plugins::StringStripper" do
  before do
    @db = Sequel::Database.new
    @c = Class.new(Sequel::Model(@db))
    @c.plugin :string_stripper
    @c.columns :name
    @o = @c.new
  end

  it "should strip all input strings" do
    @o.name = ' name '
    @o.name.should == 'name'
  end

  it "should not affect other types" do
    @o.name = 1
    @o.name.should == 1
    @o.name = Date.today
    @o.name.should == Date.today
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
sequel-3.42.0 spec/extensions/string_stripper_spec.rb
sequel-3.41.0 spec/extensions/string_stripper_spec.rb
sequel-3.40.0 spec/extensions/string_stripper_spec.rb
sequel-3.39.0 spec/extensions/string_stripper_spec.rb
sequel-3.38.0 spec/extensions/string_stripper_spec.rb
sequel-3.37.0 spec/extensions/string_stripper_spec.rb
sequel-3.36.1 spec/extensions/string_stripper_spec.rb
sequel-3.36.0 spec/extensions/string_stripper_spec.rb
sequel-3.35.0 spec/extensions/string_stripper_spec.rb
sequel-3.34.1 spec/extensions/string_stripper_spec.rb
sequel-3.34.0 spec/extensions/string_stripper_spec.rb
sequel-3.33.0 spec/extensions/string_stripper_spec.rb
sequel-3.32.0 spec/extensions/string_stripper_spec.rb
sequel-3.31.0 spec/extensions/string_stripper_spec.rb
sequel-3.30.0 spec/extensions/string_stripper_spec.rb
sequel-3.29.0 spec/extensions/string_stripper_spec.rb
sequel-3.28.0 spec/extensions/string_stripper_spec.rb
sequel-3.27.0 spec/extensions/string_stripper_spec.rb
sequel-3.26.0 spec/extensions/string_stripper_spec.rb
sequel-3.25.0 spec/extensions/string_stripper_spec.rb