Sha256: b824818baa9d3aeae28f9f2bb99b11a260920af2fdaab1450ebcdf9cd5fb182b

Contents?: true

Size: 591 Bytes

Versions: 11

Compression:

Stored size: 591 Bytes

Contents

shared_examples_for "a taggable" do
    
  before(:each) do
    @object = @klass.new
    @tags = %w(a b,c d"f)
  end
  
  describe "tags" do
    it "should be an empty array by default" do
      @object.tags.should == []
    end
    
    it "should split incoming tag lists on nulls" do
      @object.tag_list = @tags.join("\0")
      @object.tags.should == @tags
    end
    
    it "should support assignment, serializing into a null-separated tag list" do
      @object.tags = @tags
      @object.tag_list.should == @tags.join("\0")
      @object.tags.should == @tags
    end
  end
  
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vj-sdk-0.8.2 spec/shared/taggable.rb
vj-sdk-0.8.0.1 spec/shared/taggable_spec.rb
vj-sdk-0.7.14 spec/shared/taggable_spec.rb
vj-sdk-0.7.13 spec/shared/taggable_spec.rb
vj-sdk-0.7.11 spec/shared/taggable_spec.rb
vj-sdk-0.7.10 spec/shared/taggable_spec.rb
vj-sdk-0.7.9 spec/shared/taggable_spec.rb
vj-sdk-0.7.8 spec/shared/taggable_spec.rb
vj-sdk-0.7.7 spec/shared/taggable_spec.rb
vj-sdk-0.7.6 spec/shared/taggable_spec.rb
vj-sdk-0.7.5 spec/shared/taggable_spec.rb