Skip to content
This repository
Browse code

Use refute instead of negative assert

  • Loading branch information...
commit b02f19dc81efb73dd4bc8f4c62c8fccac10126c5 1 parent 1fb409f
Carlos Galdino carlosgaldino authored

Showing 2 changed files with 15 additions and 15 deletions. Show diff stats Hide diff stats

  1. +8 8 test/elixir/file_test.exs
  2. +7 7 test/elixir/regex_test.exs
16 test/elixir/file_test.exs
@@ -175,7 +175,7 @@ defmodule FileTest do
175 175
176 176 test :mkdir_with_binary do
177 177 try do
178   - assert !File.exists?("tmp_test")
  178 + refute File.exists?("tmp_test")
179 179 File.mkdir("tmp_test")
180 180 assert File.exists?("tmp_test")
181 181 after
@@ -185,7 +185,7 @@ defmodule FileTest do
185 185
186 186 test :mkdir_with_list do
187 187 try do
188   - assert !File.exists?('tmp_test')
  188 + refute File.exists?('tmp_test')
189 189 assert File.mkdir('tmp_test') == :ok
190 190 assert File.exists?('tmp_test')
191 191 after
@@ -196,12 +196,12 @@ defmodule FileTest do
196 196 test :mkdir_with_invalid_path do
197 197 assert File.exists?('test/elixir/file_test.exs')
198 198 assert File.mkdir('test/elixir/file_test.exs/test') == { :error, :enotdir }
199   - assert !File.exists?('test/elixir/file_test.exs/test')
  199 + refute File.exists?('test/elixir/file_test.exs/test')
200 200 end
201 201
202 202 test :mkdir_p_with_one_directory do
203 203 try do
204   - assert !File.exists?("tmp_test")
  204 + refute File.exists?("tmp_test")
205 205 assert File.mkdir_p("tmp_test") == :ok
206 206 assert File.exists?("tmp_test")
207 207 after
@@ -211,7 +211,7 @@ defmodule FileTest do
211 211
212 212 test :mkdir_p_with_nested_directory_and_binary do
213 213 try do
214   - assert !File.exists?("tmp_test")
  214 + refute File.exists?("tmp_test")
215 215 assert File.mkdir_p("tmp_test/test") == :ok
216 216 assert File.exists?("tmp_test")
217 217 assert File.exists?("tmp_test/test")
@@ -222,7 +222,7 @@ defmodule FileTest do
222 222
223 223 test :mkdir_p_with_nested_directory_and_list do
224 224 try do
225   - assert !File.exists?('tmp_test')
  225 + refute File.exists?('tmp_test')
226 226 assert File.mkdir_p('tmp_test/test') == :ok
227 227 assert File.exists?('tmp_test')
228 228 assert File.exists?('tmp_test/test')
@@ -233,7 +233,7 @@ defmodule FileTest do
233 233
234 234 test :mkdir_p_with_nested_directory_and_existent_parent do
235 235 try do
236   - assert !File.exists?("tmp_test")
  236 + refute File.exists?("tmp_test")
237 237 File.mkdir("tmp_test")
238 238 assert File.exists?("tmp_test")
239 239 assert File.mkdir_p("tmp_test/test") == :ok
@@ -246,7 +246,7 @@ defmodule FileTest do
246 246 test :mkdir_p_with_invalid_path do
247 247 assert File.exists?('test/elixir/file_test.exs')
248 248 assert File.mkdir('test/elixir/file_test.exs/test/foo') == { :error, :enotdir }
249   - assert !File.exists?('test/elixir/file_test.exs/test/foo')
  249 + refute File.exists?('test/elixir/file_test.exs/test/foo')
250 250 end
251 251
252 252 test :write_normal_content do
14 test/elixir/regex_test.exs
@@ -4,7 +4,7 @@ defmodule Regex.BinaryTest do
4 4 use ExUnit.Case
5 5
6 6 test :multiline do
7   - assert !Regex.match?(%r/^b$/, "a\nb\nc")
  7 + refute Regex.match?(%r/^b$/, "a\nb\nc")
8 8 assert Regex.match?(%r/^b$/m, "a\nb\nc")
9 9 end
10 10
@@ -23,14 +23,14 @@ defmodule Regex.BinaryTest do
23 23
24 24 test :match? do
25 25 assert Regex.match?(%r/foo/, "foo")
26   - assert !Regex.match?(%r/foo/, "FOO")
  26 + refute Regex.match?(%r/foo/, "FOO")
27 27 assert Regex.match?(%r/foo/i, "FOO")
28 28 assert Regex.match?(%r/\d{1,3}/i, "123")
29 29
30 30 assert Regex.match?(%r/foo/, "afooa")
31   - assert !Regex.match?(%r/^foo/, "afooa")
  31 + refute Regex.match?(%r/^foo/, "afooa")
32 32 assert Regex.match?(%r/^foo/, "fooa")
33   - assert !Regex.match?(%r/foo$/, "afooa")
  33 + refute Regex.match?(%r/foo$/, "afooa")
34 34 assert Regex.match?(%r/foo$/, "afoo")
35 35 end
36 36
@@ -98,14 +98,14 @@ defmodule Regex.ListTest do
98 98
99 99 test :match? do
100 100 assert Regex.match?(%r(foo), 'foo')
101   - assert !Regex.match?(%r(foo), 'FOO')
  101 + refute Regex.match?(%r(foo), 'FOO')
102 102 assert Regex.match?(%r(foo)i, 'FOO')
103 103 assert Regex.match?(%r/\d{1,3}/i, '123')
104 104
105 105 assert Regex.match?(%r(foo), 'afooa')
106   - assert !Regex.match?(%r(^foo), 'afooa')
  106 + refute Regex.match?(%r(^foo), 'afooa')
107 107 assert Regex.match?(%r(^foo), 'fooa')
108   - assert !Regex.match?(%r(foo$), 'afooa')
  108 + refute Regex.match?(%r(foo$), 'afooa')
109 109 assert Regex.match?(%r(foo$), 'afoo')
110 110 end
111 111

0 comments on commit b02f19d

Please sign in to comment.
Something went wrong with that request. Please try again.