require 'test_helper' module Vedeu module Generator class HelpersTestClass include Vedeu::Generator::Helpers def initialize(name) @name = name end end # HelpersTestClass describe Helpers do let(:described) { Vedeu::Generator::Helpers } let(:instance) { Vedeu::Generator::HelpersTestClass.new(_name) } let(:_name) { 'my_first_app' } describe '#app_name' do subject { instance.app_name } # it { subject.must_equal('MyFirstApp') } end describe '#app_name_as_snake_case' do let(:_name) { 'MyFirstApp' } subject { instance.app_name_as_snake_case(_name) } it { subject.must_equal('my_first_app') } end describe '#make_directory' do let(:destination) {} subject { instance.make_directory(destination) } end describe '#copy_file' do let(:source) {} let(:destination) {} subject { instance.copy_file(source, destination) } end describe '#make_file' do let(:source) {} let(:destination) {} subject { instance.make_file(source, destination) } end describe '#touch_file' do let(:destination) {} subject { instance.touch_file(destination) } end describe '#name' do let(:_name) { 'My_First_APP' } subject { instance.name } it { subject.must_be_instance_of(String) } it { subject.must_equal('my_first_app') } end describe '#name_as_class' do subject { instance.name_as_class } context 'when the name is a single value' do let(:_name) { 'VEDEU' } it { subject.must_equal('Vedeu') } end context 'when the name is an underscored value' do it { subject.must_equal('MyFirstApp') } end context 'when the name contains hyphens' do let(:_name) { 'hyphenated-APP' } it { subject.must_equal('HyphenatedApp')} end end describe '#parse' do let(:source) {} subject { instance.parse(source) } end describe '#source' do subject { instance.source } it { subject.must_be_instance_of(String) } it { subject.must_match('vedeu/generator/templates/application/.') } end end # Helpers end # Generator end # Vedeu