Sha256: c502ce8257a17b230441822f876e12e141e413057d6dc96776f0fc8b09331ed5

Contents?: true

Size: 503 Bytes

Versions: 1

Compression:

Stored size: 503 Bytes

Contents

# encoding: UTF-8

require 'spec_helper'

describe HTML, '.attributes' do
  let(:object) { described_class }

  subject { object.attributes(input) }

  examples = {
    { 'foo'  => 'bar' } => ' foo="bar"',
    { 'foo'  => '"'   } => ' foo="""',
    { 'foo'  => '&'   } => ' foo="&"',
    { :class => :baz  } => ' class="baz"'
  }

  examples.each do |input, expectation|
    context "with #{input} as input" do
      let(:input) { input }
      it { should eql(expectation) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
html-0.1.2 spec/unit/html/class_methods/attributes_spec.rb