Sha256: 5ffa5f5e49192ac567fc0b49c462d183f271ace839389bc6073e793b73db3ce3

Contents?: true

Size: 773 Bytes

Versions: 3

Compression:

Stored size: 773 Bytes

Contents

describe "Element#empty?" do
  
  before(:all) do
    elem = Element.new :div, :id => "element_empty_spec"
  
    elem.html = [
      "<div id='element_empty_spec_1'></div>",
      "<div id='element_empty_spec_2'><p></p></div>",
      "<div id='element_empty_spec_3'>         </div>"
    ].join("")
    
    Document.body << elem
  end
  
  it "should correctly return if an element is empty or not of content" do
    Document[:element_empty_spec_1].empty?.should == true
    Document[:element_empty_spec_2].empty?.should == false
  end
  
  it "should ignore whitespace if there is no other content" do
    Document[:element_empty_spec_3].empty?.should == true
  end
  
  after :all do
    # puts "running in after all"
    Document[:element_empty_spec].remove
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-0.2.2 opals/opal/browser/spec/element/empty_spec.rb
opal-0.2.0 opals/opal/browser/spec/element/empty_spec.rb
opal-0.1.0 opals/browser/spec/element/empty_spec.rb