Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use refute instead of negative assert

  • Loading branch information...
commit b02f19dc81efb73dd4bc8f4c62c8fccac10126c5 1 parent 1fb409f
Carlos Galdino carlosgaldino authored
Showing with 15 additions and 15 deletions.
  1. +8 −8 test/elixir/file_test.exs
  2. +7 −7 test/elixir/regex_test.exs
16 test/elixir/file_test.exs
View
@@ -175,7 +175,7 @@ defmodule FileTest do
test :mkdir_with_binary do
try do
- assert !File.exists?("tmp_test")
+ refute File.exists?("tmp_test")
File.mkdir("tmp_test")
assert File.exists?("tmp_test")
after
@@ -185,7 +185,7 @@ defmodule FileTest do
test :mkdir_with_list do
try do
- assert !File.exists?('tmp_test')
+ refute File.exists?('tmp_test')
assert File.mkdir('tmp_test') == :ok
assert File.exists?('tmp_test')
after
@@ -196,12 +196,12 @@ defmodule FileTest do
test :mkdir_with_invalid_path do
assert File.exists?('test/elixir/file_test.exs')
assert File.mkdir('test/elixir/file_test.exs/test') == { :error, :enotdir }
- assert !File.exists?('test/elixir/file_test.exs/test')
+ refute File.exists?('test/elixir/file_test.exs/test')
end
test :mkdir_p_with_one_directory do
try do
- assert !File.exists?("tmp_test")
+ refute File.exists?("tmp_test")
assert File.mkdir_p("tmp_test") == :ok
assert File.exists?("tmp_test")
after
@@ -211,7 +211,7 @@ defmodule FileTest do
test :mkdir_p_with_nested_directory_and_binary do
try do
- assert !File.exists?("tmp_test")
+ refute File.exists?("tmp_test")
assert File.mkdir_p("tmp_test/test") == :ok
assert File.exists?("tmp_test")
assert File.exists?("tmp_test/test")
@@ -222,7 +222,7 @@ defmodule FileTest do
test :mkdir_p_with_nested_directory_and_list do
try do
- assert !File.exists?('tmp_test')
+ refute File.exists?('tmp_test')
assert File.mkdir_p('tmp_test/test') == :ok
assert File.exists?('tmp_test')
assert File.exists?('tmp_test/test')
@@ -233,7 +233,7 @@ defmodule FileTest do
test :mkdir_p_with_nested_directory_and_existent_parent do
try do
- assert !File.exists?("tmp_test")
+ refute File.exists?("tmp_test")
File.mkdir("tmp_test")
assert File.exists?("tmp_test")
assert File.mkdir_p("tmp_test/test") == :ok
@@ -246,7 +246,7 @@ defmodule FileTest do
test :mkdir_p_with_invalid_path do
assert File.exists?('test/elixir/file_test.exs')
assert File.mkdir('test/elixir/file_test.exs/test/foo') == { :error, :enotdir }
- assert !File.exists?('test/elixir/file_test.exs/test/foo')
+ refute File.exists?('test/elixir/file_test.exs/test/foo')
end
test :write_normal_content do
14 test/elixir/regex_test.exs
View
@@ -4,7 +4,7 @@ defmodule Regex.BinaryTest do
use ExUnit.Case
test :multiline do
- assert !Regex.match?(%r/^b$/, "a\nb\nc")
+ refute Regex.match?(%r/^b$/, "a\nb\nc")
assert Regex.match?(%r/^b$/m, "a\nb\nc")
end
@@ -23,14 +23,14 @@ defmodule Regex.BinaryTest do
test :match? do
assert Regex.match?(%r/foo/, "foo")
- assert !Regex.match?(%r/foo/, "FOO")
+ refute Regex.match?(%r/foo/, "FOO")
assert Regex.match?(%r/foo/i, "FOO")
assert Regex.match?(%r/\d{1,3}/i, "123")
assert Regex.match?(%r/foo/, "afooa")
- assert !Regex.match?(%r/^foo/, "afooa")
+ refute Regex.match?(%r/^foo/, "afooa")
assert Regex.match?(%r/^foo/, "fooa")
- assert !Regex.match?(%r/foo$/, "afooa")
+ refute Regex.match?(%r/foo$/, "afooa")
assert Regex.match?(%r/foo$/, "afoo")
end
@@ -98,14 +98,14 @@ defmodule Regex.ListTest do
test :match? do
assert Regex.match?(%r(foo), 'foo')
- assert !Regex.match?(%r(foo), 'FOO')
+ refute Regex.match?(%r(foo), 'FOO')
assert Regex.match?(%r(foo)i, 'FOO')
assert Regex.match?(%r/\d{1,3}/i, '123')
assert Regex.match?(%r(foo), 'afooa')
- assert !Regex.match?(%r(^foo), 'afooa')
+ refute Regex.match?(%r(^foo), 'afooa')
assert Regex.match?(%r(^foo), 'fooa')
- assert !Regex.match?(%r(foo$), 'afooa')
+ refute Regex.match?(%r(foo$), 'afooa')
assert Regex.match?(%r(foo$), 'afoo')
end
Please sign in to comment.
Something went wrong with that request. Please try again.