Sha256: b97614db1b94a2caa82187afb725a54a7111f832d69548d6409902302b433378

Contents?: true

Size: 690 Bytes

Versions: 7

Compression:

Stored size: 690 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'
require "thor"
require "thor/tasks"

# bleh. testing private methods?
class <<Thor
  public :convert_task_options
end

describe "thor" do
  describe "convert_task_options" do
    it "turns true values into a flag" do
      Thor.convert_task_options(:color => true).must == "--color"
    end
    
    it "ignores nil" do
      Thor.convert_task_options(:color => nil).must == ""
    end
    
    it "ignores false" do
      Thor.convert_task_options(:color => false).must == ""
    end
    
    it "writes --name value for anything else" do
      Thor.convert_task_options(:format => "specdoc").must == %{--format "specdoc"}
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090408130025 lib/thor/spec/tasks_spec.rb
sproutit-sproutcore-1.0.0.20090416161445 lib/thor/spec/tasks_spec.rb
sproutit-sproutcore-1.0.0.20090720093355 lib/thor/spec/tasks_spec.rb
sproutit-sproutcore-1.0.0.20090720202429 lib/thor/spec/tasks_spec.rb
sproutit-sproutcore-1.0.0.20090721125122 lib/thor/spec/tasks_spec.rb
sproutit-sproutcore-1.0.126 lib/thor/spec/tasks_spec.rb
sproutcore-1.0.1003 lib/thor/spec/tasks_spec.rb