Class: QueryWrapperTest
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- QueryWrapperTest
- Defined in:
- lib/regexp_wrapper/query_wrapper_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_has ⇒ Object
- #test_match_end_with ⇒ Object
- #test_match_start_with ⇒ Object
- #test_match_start_with_a_and_end_with_c ⇒ Object
- #test_start_with_and_end_with ⇒ Object
Instance Method Details
#setup ⇒ Object
6 7 8 |
# File 'lib/regexp_wrapper/query_wrapper_test.rb', line 6 def setup @queryWrapper = RegexpWrapper::QueryWrapper.new end |
#test_has ⇒ Object
15 16 17 18 |
# File 'lib/regexp_wrapper/query_wrapper_test.rb', line 15 def test_has express = @queryWrapper.start_with!("a").has!("BBB").has!("DDD").end_with!("z").to_regexp assert_equal(/^a.*BBB.*DDD.*z\z/,express) end |
#test_match_end_with ⇒ Object
24 25 26 |
# File 'lib/regexp_wrapper/query_wrapper_test.rb', line 24 def test_match_end_with assert("abc" =~ @queryWrapper.end_with!("c").to_regexp) end |
#test_match_start_with ⇒ Object
20 21 22 |
# File 'lib/regexp_wrapper/query_wrapper_test.rb', line 20 def test_match_start_with assert("abc" =~ @queryWrapper.start_with!("a").to_regexp) end |
#test_match_start_with_a_and_end_with_c ⇒ Object
28 29 30 31 32 |
# File 'lib/regexp_wrapper/query_wrapper_test.rb', line 28 def test_match_start_with_a_and_end_with_c assert(@queryWrapper.start_with!("a").end_with!("c") =~ "abc") assert_match(@queryWrapper.start_with!("a").end_with!("c").to_regexp,"abc") refute_match(@queryWrapper.start_with!("a").end_with!("c").to_regexp,"abd") end |
#test_start_with_and_end_with ⇒ Object
10 11 12 13 |
# File 'lib/regexp_wrapper/query_wrapper_test.rb', line 10 def test_start_with_and_end_with express = @queryWrapper.start_with!("a").end_with!("z").to_regexp assert_equal(/^a.*z\z/,express) end |