spec/lib/rgentpl/command/generate_spec.rb in rgentpl-1.2.6 vs spec/lib/rgentpl/command/generate_spec.rb in rgentpl-2.0.0

- old
+ new

@@ -1,38 +1,38 @@ -require 'spec_helper' -require 'fileutils' +require "spec_helper" +require "fileutils" describe Rgentpl::Command::Generate do - let(:app) { 'test_app' } + let(:app) { "test_app" } before do - Rgentpl::Command::Base.start %W( generate #{app} ) + Rgentpl::Command::Base.start %W[generate #{app}] end let(:path) do - Rgentpl::Command::Generate.class_options[:app_path].default.chomp('/') + Rgentpl::Command::Generate.class_options[:app_path].default.chomp("/") end let(:file) { "#{path}/#{app}" } after do FileUtils.rm_rf(file) if File.exist?(file) end - describe '#source_root' do - it 'sets application source path root' do + describe "#source_root" do + it "sets application source path root" do expect(Rgentpl::Command::Generate.source_root) - .to eq File.absolute_path(File.join(File.dirname(__FILE__), '../../../../')) + .to eq File.absolute_path(File.join(File.dirname(__FILE__), "../../../../")) end end - describe '.create_app' do - it 'adds a new directory with defined structure' do + describe ".create_app" do + it "adds a new directory with defined structure" do expect(File.exist?(file)).to be end end - describe '.add_perms' do - it 'add executions perms to binary file' do + describe ".add_perms" do + it "add executions perms to binary file" do expect(File.stat(File.join(file, "/bin/#{app}")).mode).to eq 33_261 end end end