Sha256: ee57c0b74088b02c3177bfa51677ae17b44725d510b011641ac6f3def3e34c49

Contents?: true

Size: 287 Bytes

Versions: 3

Compression:

Stored size: 287 Bytes

Contents

require 'spec_helper'

class Foo
  include Transformable
  attr_accessor :title
  clean(:title) { |v| v.gsub(/\s/, "")}
end

describe Transformable do
  it "used the provided block to filter attributes" do
    f = Foo.new
    f.title = "bar bar"
    f.title.should == "barbar"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
transformable-0.0.4 spec/transformable_spec.rb
transformable-0.0.2 spec/transformable_spec.rb
transformable-0.0.1 spec/transformable_spec.rb