add .travis.yml

This commit is contained in:
keepcosmos 2016-04-23 13:21:57 +09:00
parent c122c74735
commit f69365c4a4
3 changed files with 8 additions and 4 deletions

4
.travis.yml Normal file
View File

@ -0,0 +1,4 @@
language: elixir
elixir:
- 1.2.2

View File

@ -21,12 +21,12 @@ defmodule Readability.HelperTest do
""" """
setup do setup do
html_tree = Readability.parse(@sample) html_tree = Floki.parse(@sample)
{:ok, html_tree: html_tree} {:ok, html_tree: html_tree}
end end
test "change font tag to span", %{html_tree: html_tree} do test "change font tag to span", %{html_tree: html_tree} do
expectred = @sample |> String.replace(~r/font/, "span") |> parse expectred = @sample |> String.replace(~r/font/, "span") |> Floki.parse
result = Helper.change_tag(html_tree, "font", "span") result = Helper.change_tag(html_tree, "font", "span")
assert result == expectred assert result == expectred
end end

View File

@ -24,11 +24,11 @@ defmodule ReadabilityTest do
test "readability for medium" do test "readability for medium" do
%{status_code: 200, body: body} = HTTPoison.get!("https://medium.com/@kenmazaika/why-im-betting-on-elixir-7c8f847b58#.d0xmzfd15") %{status_code: 200, body: body} = HTTPoison.get!("https://medium.com/@kenmazaika/why-im-betting-on-elixir-7c8f847b58#.d0xmzfd15")
IO.inspect Readability.content(body) |> Readability.readabl_text Readability.content(body) |> Readability.readabl_text
end end
test "readability for buzzfeed" do test "readability for buzzfeed" do
%{status_code: 200, body: body} = HTTPoison.get!("http://www.buzzfeed.com/salvadorhernandez/fbi-obtains-passcode-to-iphone-in-new-york-drops-case-agains#.koMMa21lj8") %{status_code: 200, body: body} = HTTPoison.get!("http://www.buzzfeed.com/salvadorhernandez/fbi-obtains-passcode-to-iphone-in-new-york-drops-case-agains#.koMMa21lj8")
IO.inspect Readability.content(body) |> Readability.readabl_text Readability.content(body) |> Readability.readabl_text
end end
end end