spec/unit/generators/definition_generator_spec.rb in puppet-retrospec-1.4.0 vs spec/unit/generators/definition_generator_spec.rb in puppet-retrospec-1.4.1
- old
+ new
@@ -1,10 +1,10 @@
require 'spec_helper'
describe Retrospec::Puppet::Generators::DefinitionGenerator do
- after(:each) do
- FileUtils.rm(spec_file) if File.exist?(spec_file)
+ before(:each) do
+ FileUtils.rm_rf(spec_files_path) if File.exist?(spec_files_path)
end
let(:generator_opts) do
{ :manifest_file => sample_file, :template_dir => retrospec_templates_path }
end
@@ -81,13 +81,13 @@
end
describe 'spec files' do
let(:generated_files) do
[File.join(spec_files_path, 'one_define_spec.rb'),
- File.join(spec_files_path, 'sub', 'settings_define_spec.rb')]
+ File.join(spec_files_path, 'sub', 'settings_define_spec.rb')].sort
end
it 'should generate a bunch of files' do
files = Retrospec::Puppet::Generators::DefinitionGenerator.generate_spec_files(module_path, generator_opts)
- expect(files).to eq(generated_files)
+ expect(files.sort).to eq(generated_files)
end
end
end