Skip to content

Commit 3ea88d6

Browse files
committed
Renames must_not_parse to wont_parse to follow minitest conventions
1 parent fa314c0 commit 3ea88d6

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

test/csscss/parser/background_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def trans(s)
2020
@parser.bg_position.must_parse("left bottom")
2121
@parser.bg_position.must_parse("inherit")
2222
@parser.bg_position.must_parse("bottom")
23-
@parser.bg_position.must_not_parse("bottom left")
24-
@parser.bg_position.must_not_parse("inherit bottom")
23+
@parser.bg_position.wont_parse("bottom left")
24+
@parser.bg_position.wont_parse("inherit bottom")
2525
end
2626

2727
it "converts shorthand rules to longhand" do
@@ -51,7 +51,7 @@ def trans(s)
5151
end
5252

5353
it "doesn't parse unknown values" do
54-
@parser.must_not_parse("foo")
54+
@parser.wont_parse("foo")
5555
end
5656

5757
it "tries the parse and returns false if it doesn't work" do

test/csscss/parser/color_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ class ColorTest
2222
it "parses rgb number color" do
2323
@parser.rgb.must_parse "rgb(123, 222, 444)"
2424
@parser.rgb.must_parse "rgb ( 123 , 222 , 444 ) "
25-
@parser.rgb.must_not_parse "rgb(1aa, 222, 444)"
25+
@parser.rgb.wont_parse "rgb(1aa, 222, 444)"
2626
end
2727

2828
it "parses rgb percentage color" do
2929
@parser.rgb.must_parse "rgb(123%, 222%, 444%)"
3030
@parser.rgb.must_parse "rgb ( 123% , 222% , 444% ) "
31-
@parser.rgb.must_not_parse "rgb(1aa%, 222%, 444%)"
31+
@parser.rgb.wont_parse "rgb(1aa%, 222%, 444%)"
3232
end
3333

3434
it "parses hex colors" do
3535
@parser.hexcolor.must_parse "#ffffff"
3636
@parser.hexcolor.must_parse "#ffffff "
3737
@parser.hexcolor.must_parse "#fff "
3838
@parser.hexcolor.must_parse "#fFF123"
39-
@parser.hexcolor.must_not_parse "fFF123"
39+
@parser.hexcolor.wont_parse "fFF123"
4040
end
4141

4242
it "parses keyword colors" do

test/csscss/parser/common_test.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CommonTest
1212
it "parses case insensitive strings" do
1313
@parser.stri("a").must_parse "a"
1414
@parser.stri("A").must_parse "a"
15-
@parser.stri("A").must_not_parse "b"
15+
@parser.stri("A").wont_parse "b"
1616

1717
@parser.stri("This too shall pass").must_parse "this TOO shall PASS"
1818
@parser.stri("[").must_parse "["
@@ -23,9 +23,9 @@ class CommonTest
2323
it "parses series of spaces" do
2424
@parser.space.must_parse " "
2525
@parser.space.must_parse " "
26-
@parser.space.must_not_parse " a"
26+
@parser.space.wont_parse " a"
2727

28-
@parser.space.must_not_parse ""
28+
@parser.space.wont_parse ""
2929
@parser.space?.must_parse ""
3030
end
3131
end
@@ -35,7 +35,7 @@ class CommonTest
3535
@parser.symbol("foo").must_parse "foo"
3636
@parser.symbol("foo").must_parse "foo "
3737
@parser.symbol("foo").must_parse "Foo "
38-
@parser.symbol("foo").must_not_parse " Foo "
38+
@parser.symbol("foo").wont_parse " Foo "
3939
end
4040

4141
it "optionally captures input" do
@@ -53,52 +53,52 @@ class CommonTest
5353
@parser.parens { @parser.symbol("foo") }.must_parse "(foo)"
5454
@parser.parens { @parser.symbol("foo") }.must_parse "(FOo) "
5555
@parser.parens { @parser.symbol("foo") }.must_parse "(FOo ) "
56-
@parser.parens { @parser.symbol("food") }.must_not_parse "(FOo"
56+
@parser.parens { @parser.symbol("food") }.wont_parse "(FOo"
5757
end
5858

5959
it "parses input surrounded by double quotes" do
6060
@parser.double_quoted { @parser.symbol("foo") }.must_parse %("foo")
6161
@parser.double_quoted { @parser.symbol("foo") }.must_parse %("FOo ")
6262
@parser.double_quoted { @parser.symbol("foo") }.must_parse %("FOo " )
63-
@parser.double_quoted { @parser.symbol("food") }.must_not_parse %("FOo)
63+
@parser.double_quoted { @parser.symbol("food") }.wont_parse %("FOo)
6464
end
6565

6666
it "parses input surrounded by single quotes" do
6767
@parser.single_quoted { @parser.symbol('foo') }.must_parse %('foo')
6868
@parser.single_quoted { @parser.symbol('foo') }.must_parse %('FOo ')
6969
@parser.single_quoted { @parser.symbol('foo') }.must_parse %('FOo ' )
70-
@parser.single_quoted { @parser.symbol('food') }.must_not_parse %('FOo)
70+
@parser.single_quoted { @parser.symbol('food') }.wont_parse %('FOo)
7171
end
7272
end
7373

7474
describe "number and numbers" do
7575
it "parses single numbers" do
7676
@parser.number.must_parse "1"
77-
@parser.number.must_not_parse "12"
78-
@parser.number.must_not_parse "a"
79-
@parser.number.must_not_parse "1 "
77+
@parser.number.wont_parse "12"
78+
@parser.number.wont_parse "a"
79+
@parser.number.wont_parse "1 "
8080
end
8181

8282
it "parses multiple numbers" do
8383
@parser.numbers.must_parse "1"
8484
@parser.numbers.must_parse "12"
85-
@parser.numbers.must_not_parse "12 "
86-
@parser.numbers.must_not_parse "1223a"
85+
@parser.numbers.wont_parse "12 "
86+
@parser.numbers.wont_parse "1223a"
8787
end
8888

8989
it "parses decimals" do
9090
@parser.decimal.must_parse "1"
9191
@parser.decimal.must_parse "12"
9292
@parser.decimal.must_parse "12."
9393
@parser.decimal.must_parse "12.0123"
94-
@parser.decimal.must_not_parse "1223a"
94+
@parser.decimal.wont_parse "1223a"
9595
end
9696

9797
it "parses percentages" do
9898
@parser.percent.must_parse "100%"
9999
@parser.percent.must_parse "100% "
100100
@parser.percent.must_parse "100.344%"
101-
@parser.percent.must_not_parse "100 %"
101+
@parser.percent.wont_parse "100 %"
102102
end
103103

104104
it "parses lengths" do

test/csscss/parser/list_style_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def trans(s)
2525
end
2626

2727
it "doesn't parse unknown values" do
28-
@parser.must_not_parse("foo")
28+
@parser.wont_parse("foo")
2929
end
3030

3131
it "tries the parse and returns false if it doesn't work" do

test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ def assert_not_parse(parser, string)
3737
end
3838

3939
Parslet::Atoms::DSL.infect_an_assertion :assert_parse, :must_parse, :do_not_flip
40-
Parslet::Atoms::DSL.infect_an_assertion :assert_not_parse, :must_not_parse, :do_not_flip
40+
Parslet::Atoms::DSL.infect_an_assertion :assert_not_parse, :wont_parse, :do_not_flip

0 commit comments

Comments
 (0)