Sha256: 20efccba3994f4657fd6df7fa999346a99db8380d063df6e67d10ecd61c769a2

Contents?: true

Size: 723 Bytes

Versions: 2

Compression:

Stored size: 723 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'shoulda'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'addthis'

class Test::Unit::TestCase

  class << self
    %w(alt href src title).each do |attribute|
      define_method(:"should_set_#{attribute}_to") do |expected|
        should "set #{attribute} to '#{expected}'" do
          assert_equal %Q{#{attribute}="#{expected}"}, @output[/#{attribute}="[^"]*"/]
        end
      end
    end

    def should_set_script_src_to(expected)
      context "" do
        setup do
          @output = @output[/<script.+src=[^>]+>/]
        end

        should_set_src_to expected
      end
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jaap3-addthis-0.2.0 test/test_helper.rb
jaap3-addthis-0.2.1 test/test_helper.rb