Sha256: f371aac1f73a2d630cad1ea14a9603dffdc4b51025c589b22ab738c6b53ea9fe

Contents?: true

Size: 1.52 KB

Versions: 4

Compression:

Stored size: 1.52 KB

Contents

require 'helper'

describe "PryTheme::Commands" do
  describe "color option" do
    it "should display a color when given a numeric argument" do
      mock_pry(binding, "pry-theme -c 23").should =~ /dark_turquoise/
    end

    it "should display warning when invalid color number given" do
      out = mock_pry("pry-theme -c 1000")
      out.should =~ /Invalid color: 1000/
    end

    it "should display warning when random symbols given" do
      out = mock_pry("pry-theme -c $_dopey+")
      out.should =~ /Invalid color: \$_dopey\+/
    end

    it "should display a color when a hex given" do
      mock_pry("pry-theme -c #625a2d").should =~ /khaki01/
    end

    it "should display a color when an rgb given" do
      mock_pry("pry-theme -c 95,196,60").should =~ /pale_green01/
    end

    it "should display a color when a human-readable name given" do
      mock_pry("pry-theme -c steel_blue").should =~ /steel_blue/
    end

    it "should display multiple colors when a substring given" do
      out = mock_pry("pry-theme -c dark_t")

      out.should =~ /dark_turquoise/
      out.should =~ /dark_tan/
      out.should =~ /dark_tea_green/
    end
  end

  describe "all-colors option" do
    it "should display all colors for 8-color palette" do
      out = mock_pry("pry-theme -a 8")

      out.should =~ /black/
      out.should =~ /magenta/
    end

    #it "should display all colors for 256-color palette" do
      #out = mock_pry("pry-theme -a 256")

      #out.should =~ /black/
      #out.should =~ /seashell/
    #end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pry-theme-0.1.3 test/test_commands.rb
pry-theme-0.1.2 test/test_commands.rb
pry-theme-0.1.1 test/test_commands.rb
pry-theme-0.1.0 test/test_commands.rb