forked from Shopify/dashing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli_test.rb
More file actions
28 lines (23 loc) · 809 Bytes
/
Copy pathcli_test.rb
File metadata and controls
28 lines (23 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'test_helper'
silent{ load 'bin/dashing' }
module Thor::Actions
def source_paths
[File.join(File.expand_path(File.dirname(__FILE__)), '../templates')]
end
end
class CliTest < Dashing::Test
def test_project_directory_created
temp do |dir|
cli = Dashing::CLI.new
silent{ cli.new 'Dashboard' }
assert Dir.exist?(File.join(dir,'dashboard')), 'Dashing directory was not created.'
end
end
def test_hyphenate
assert_equal 'power', Dashing::CLI.hyphenate('Power')
assert_equal 'power', Dashing::CLI.hyphenate('POWER')
assert_equal 'power-rangers', Dashing::CLI.hyphenate('PowerRangers')
assert_equal 'power-ranger', Dashing::CLI.hyphenate('Power_ranger')
assert_equal 'super-power-rangers', Dashing::CLI.hyphenate('SuperPowerRangers')
end
end