Skip to content

Commit

Permalink
fix rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
humblerookie committed Jun 14, 2024
1 parent bc057fd commit 258a063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions lib/arkana/dart_code_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ def self.set_up_dart_classes(sources_dir, tests_dir, template_arguments, config)
tests_template = File.read("#{dirname}/templates/dart/arkana_tests.dart.erb")
FileUtils.mkdir_p(sources_dir)
if config.should_generate_unit_tests
FileUtils.mkdir_p(tests_dir)
FileUtils.mkdir_p(tests_dir)
end
render(source_template, template_arguments, File.join(sources_dir, "#{config.namespace.downcase}.dart"))
if config.should_generate_unit_tests
render(tests_template, template_arguments, File.join(tests_dir, "#{config.namespace.downcase}_test.dart"))
end
return unless config.should_generate_unit_tests
render(tests_template, template_arguments, File.join(tests_dir, "#{config.namespace.downcase}_test.dart"))
end

def self.render(template, template_arguments, destination_file)
Expand Down
4 changes: 2 additions & 2 deletions spec/dart_code_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
allow(ENV).to receive(:[]).with("ARKANA_RUNNING_CI_INTEGRATION_TESTS").and_return(true)
end

after {
after do
FileUtils.rm_rf(File.join("lib", config.result_path))
FileUtils.rm_rf(File.join("test"))
}
end

describe ".generate" do
let(:dart_module_dir) { config.result_path }
Expand Down

0 comments on commit 258a063

Please sign in to comment.