defmodule MetaInspectorTest do
  use ExUnit.Case

  @html File.read! "test/html/utf8.html"

  @shift_jis File.read! "test/html/shift_jis.html"

  test "title" do
    assert "MetaInspector" == MetaInspector.title(@html)
  end

  test "og_title" do
    assert ["MetaInspector in Test"] == MetaInspector.og_title(@html)
  end

  test "og_image" do
    assert ["http://img.example.com"] == MetaInspector.og_image(@html)
  end

  test "og_type" do
    assert ["article"] == MetaInspector.og_type(@html)
  end

  test "og_url" do
    assert ["http://example.com"] == MetaInspector.og_url(@html)
  end

  test "best_title" do
    assert "MetaInspector in Test" == MetaInspector.best_title(@html)
  end

  test "to_utf8 with utf8" do
    assert @html == MetaInspector.to_utf8(@html)
  end

  test "to_utf8 with shift-jis" do
    assert_raise UnicodeConversionError, fn ->
       String.to_char_list(@shift_jis)
    end
  end
end

defmodule MetaInspectorTest do
  use ExUnit.Case

  @html File.read! "test/html/utf8.html"

  @shift_jis File.read! "test/html/shift_jis.html"

  test "title" do
    assert MetaInspector.title(@html) == "MetaInspector"
  end

  test "og_title" do
    assert MetaInspector.og_title(@html) == ["MetaInspector in Test"]
  end

  test "og_image" do
    assert MetaInspector.og_image(@html) == ["http://img.example.com"]
  end

  test "og_type" do
    assert MetaInspector.og_type(@html) == ["article"]
  end

  test "og_url" do
    assert MetaInspector.og_url(@html) == ["http://example.com"]
  end

  test "best_title" do
    assert MetaInspector.best_title(@html) == "MetaInspector in Test"
  end

  test "to_utf8 with utf8" do
    assert MetaInspector.to_utf8(@html) == @html 
  end

  test "to_utf8 with shift-jis" do
    assert_raise UnicodeConversionError, fn ->
       String.to_char_list(@shift_jis)
    end
  end
end

Replace lhs with rhs in test
Replace lhs with rhs in test

nekova/metainvestigator