palindrome-jagzzs 0.0.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/palindrome.rb +3 -1
 - data/test/tc_palindrome.rb +18 -5
 - metadata +1 -3
 - data/bin/palindromo +0 -5
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f6655bfa3047471610dafb18babdedea07241366
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 79e6bb90322c83e26eeec6276f15f009150150e2
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e33e1aed9732393c5321ad6a81894aa9d91d1a16e4fd121eeabbca672a46ba17502ac80944d90b0b1901d5b7021f11fad5327e92ba59225b9b46784033f95142
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c96a8969a71c7fc76c8f79283ef25f8e3cc6ef35f331810b6ff817e7ae142560527aa9a7aeb2dcf7dc9798429d70ee8f707324d1f0c8c91c8950c407ad7b5d9c
         
     | 
    
        data/lib/palindrome.rb
    CHANGED
    
    
    
        data/test/tc_palindrome.rb
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            require "palindrome"
         
     | 
| 
       2 
2 
     | 
    
         
             
            require "test/unit"
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            class TestPalindrome < Test::Unit::TestCase
         
     | 
| 
         @@ -41,8 +41,14 @@ class TestPalindrome < Test::Unit::TestCase 
     | 
|
| 
       41 
41 
     | 
    
         
             
                assert_equal(phrase.palindrome?, false, "The phrase \"" + phrase + "\" returned that's a palindrome")
         
     | 
| 
       42 
42 
     | 
    
         
             
              end
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
              def  
     | 
| 
       45 
     | 
    
         
            -
                assert_raise(SystemExit)  
     | 
| 
      
 44 
     | 
    
         
            +
              def test_invalid_input_exits_with_1
         
     | 
| 
      
 45 
     | 
    
         
            +
                assert_raise(SystemExit) do
         
     | 
| 
      
 46 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 47 
     | 
    
         
            +
                    evaluate_input("This is clearly not a palindrome")
         
     | 
| 
      
 48 
     | 
    
         
            +
                  rescue SystemExit => e
         
     | 
| 
      
 49 
     | 
    
         
            +
                    raise e if e.status == 1
         
     | 
| 
      
 50 
     | 
    
         
            +
                  end
         
     | 
| 
      
 51 
     | 
    
         
            +
                end
         
     | 
| 
       46 
52 
     | 
    
         
             
              end
         
     | 
| 
       47 
53 
     | 
    
         | 
| 
       48 
54 
     | 
    
         
             
              #positive tests
         
     | 
| 
         @@ -83,7 +89,14 @@ class TestPalindrome < Test::Unit::TestCase 
     | 
|
| 
       83 
89 
     | 
    
         
             
                assert_equal(phrase.palindrome?, true, "The phrase \"" + phrase + "\" returned that's not a palindrome")
         
     | 
| 
       84 
90 
     | 
    
         
             
              end
         
     | 
| 
       85 
91 
     | 
    
         | 
| 
       86 
     | 
    
         
            -
              def  
     | 
| 
       87 
     | 
    
         
            -
                assert_nothing_raised(SystemExit)  
     | 
| 
      
 92 
     | 
    
         
            +
              def test_valid_input_exits_with_0
         
     | 
| 
      
 93 
     | 
    
         
            +
                assert_nothing_raised(SystemExit) do
         
     | 
| 
      
 94 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 95 
     | 
    
         
            +
                    evaluate_input("abba")
         
     | 
| 
      
 96 
     | 
    
         
            +
                  rescue SystemExit => e
         
     | 
| 
      
 97 
     | 
    
         
            +
                    raise e unless e.status == 0
         
     | 
| 
      
 98 
     | 
    
         
            +
                  end
         
     | 
| 
      
 99 
     | 
    
         
            +
                end
         
     | 
| 
       88 
100 
     | 
    
         
             
              end
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
       89 
102 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: palindrome-jagzzs
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jesus Gonzalez
         
     | 
| 
         @@ -14,12 +14,10 @@ description: Simple algorithm for analyzing if user's input is a palindrome. 
     | 
|
| 
       14 
14 
     | 
    
         
             
            email: jagzzs21@gmail.com
         
     | 
| 
       15 
15 
     | 
    
         
             
            executables:
         
     | 
| 
       16 
16 
     | 
    
         
             
            - palindrome
         
     | 
| 
       17 
     | 
    
         
            -
            - palindromo
         
     | 
| 
       18 
17 
     | 
    
         
             
            extensions: []
         
     | 
| 
       19 
18 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       20 
19 
     | 
    
         
             
            files:
         
     | 
| 
       21 
20 
     | 
    
         
             
            - bin/palindrome
         
     | 
| 
       22 
     | 
    
         
            -
            - bin/palindromo
         
     | 
| 
       23 
21 
     | 
    
         
             
            - lib/palindrome.rb
         
     | 
| 
       24 
22 
     | 
    
         
             
            - test/tc_palindrome.rb
         
     | 
| 
       25 
23 
     | 
    
         
             
            homepage: http://rubygems.org/gems/palindrome_jagzzs
         
     |