Sha256: 78fd380e476f3aa00d7438590a80b31d3266fdab14b30ffe73c25c94e3210244

Contents?: true

Size: 548 Bytes

Versions: 7

Compression:

Stored size: 548 Bytes

Contents

require 'spec_helper'

describe 'Kernel' do
  describe '.DOM()' do
    html <<-HTML
      <div class="spec"></div>
      <div class="sock"></div>
    HTML

    it "parses HTML" do
      expect($document['.spec'].element?).to be_truthy
      expect($document['.sock'].element?).to be_truthy
    end

    it "appends classes correctly" do
      elem = DOM {
        div.class1.class2(class: "class-3 class-4", classes: %w[class-5 class-6])
      }

      expect(elem =~ ".class1.class2.class-3.class-4.class-5.class-6").to eq(true)
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
opal-browser-0.3.5 spec/dom_spec.rb
opal-browser-0.3.4 spec/dom_spec.rb
atome-opal-browser-0.3.9.5 spec/dom_spec.rb
opal-browser-0.3.3 spec/dom_spec.rb
opal-browser-0.3.2 spec/dom_spec.rb
opal-browser-0.3.1 spec/dom_spec.rb
opal-browser-0.3.0 spec/dom_spec.rb