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.180 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.179 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.178 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.177 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.176 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.175 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.174 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.173 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.172 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.171 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.170 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.169 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.167 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.166 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.165 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.164 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.163 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.162 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.161 tracks/crystal/exercises/pangram/spec/pangram_spec.cr
trackler-2.2.1.160 tracks/crystal/exercises/pangram/spec/pangram_spec.cr