Sha256: d3c47f4df8f9c5afc85e204a33a778eb135ce1516a0a60e34addcc5a3fc66b5e

Contents?: true

Size: 1.62 KB

Versions: 382

Compression:

Stored size: 1.62 KB

Contents

require "spec"
require "../src/*"

describe "Pangram" do
  describe "#pangram?" do
    it "should reject an empty string" do
      str = ""
      Pangram.pangram?(str).should be_false
    end

    pending "should accept a pangram with only lower case" do
      str = "the quick brown fox jumps over the lazy dog"
      Pangram.pangram?(str).should be_true
    end

    pending "should reject a string missing character 'x'" do
      str = "a quick movement of the enemy will jeopardize five gunboats"
      Pangram.pangram?(str).should be_false
    end

    pending "should reject another string missing character 'x'" do
      str = "the quick brown fish jumps over the lazy dog"
      Pangram.pangram?(str).should be_false
    end

    pending "should accept a pangram with underscores" do
      str = "the_quick_brown_fox_jumps_over_the_lazy_dog"
      Pangram.pangram?(str).should be_true
    end

    pending "should accept a pangram with numbers" do
      str = "the 1 quick brown fox jumps over the 2 lazy dogs"
      Pangram.pangram?(str).should be_true
    end

    pending "should reject a string where missing letters replaced by numbers" do
      str = "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog"
      Pangram.pangram?(str).should be_false
    end

    pending "should accept a pangram with mixed case and punctuation" do
      str = "\"Five quacking Zephyrs jolt my wax bed.\""
      Pangram.pangram?(str).should be_true
    end

    pending "should accept a pangram with non ascii characters" do
      str = "Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich."
      Pangram.pangram?(str).should be_true
    end
  end
end

Version data entries

382 entries across 382 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.97 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.96 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.95 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.94 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.93 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.92 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.91 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.90 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.89 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.88 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.87 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.86 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.85 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.84 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.83 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.82 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.81 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.80 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.79 tracks/crystal/exercises/pangram/spec/pangram_spec.cr