Sha256: 680b765ea35a174bd9d7b41fc6172ef8721b636791b01d2202c186bd49835b91

Contents?: true

Size: 825 Bytes

Versions: 13

Compression:

Stored size: 825 Bytes

Contents

describe "Rows" do
  it "method_missing should work" do
    r = Formotion::Row.new
    r.title = "LABEL"
    r.title.should == "LABEL"

    r.title = "LABEL2"
    r.title.should == "LABEL2"
  end

  it "from hash should work" do
    hash = {title: "TITLE", subtitle: "SUBTITLE"}
    r = Formotion::Row.new(hash)
    r.title.should == "TITLE"
    r.subtitle.should == "SUBTITLE"
  end

  it "the question mark methods should work" do
    r = Formotion::Row.new({secure: true, title: "Not Boolean"})
    r.secure?.should == true
    should.raise(NoMethodError) {
      r.title?.should == true
    }
  end

  it "should allow arrays and blocks for items" do
    r = Formotion::Row.new()
    r.items = [1, 2, 3]
    r.items.should == [1, 2, 3]

    r.items = lambda { [1, 2, 3].reverse }
    r.items.should == [3, 2, 1]
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
formotion-1.6 spec/row_spec.rb
formotion-1.5.1 spec/row_spec.rb
formotion-1.5.0 spec/row_spec.rb
formotion-1.4.0 spec/row_spec.rb
formotion-1.3.1 spec/row_spec.rb
formotion-1.3 spec/row_spec.rb
formotion-1.2 spec/row_spec.rb
formotion-1.1.5 spec/row_spec.rb
formotion-1.1.4 spec/row_spec.rb
formotion-1.1.3 spec/row_spec.rb
formotion-1.1.2 spec/row_spec.rb
formotion-1.1.1 spec/row_spec.rb
formotion-1.1 spec/row_spec.rb