From f760a7413cc296c51faeb1a14a3f68dd94cd4dea Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Fri, 23 Apr 2021 15:20:44 +0200 Subject: [PATCH] Spec: Add a minimal spec file for SourceCode --- spec/unit/modulesync/source_code_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 spec/unit/modulesync/source_code_spec.rb diff --git a/spec/unit/modulesync/source_code_spec.rb b/spec/unit/modulesync/source_code_spec.rb new file mode 100644 index 00000000..8317aeb9 --- /dev/null +++ b/spec/unit/modulesync/source_code_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe ModuleSync::SourceCode do + before do + options = ModuleSync.config_defaults.merge({ + git_base: 'file:///tmp/dummy', + }) + ModuleSync.instance_variable_set '@options', options + end + + subject do + ModuleSync::SourceCode.new('namespace/name', nil) + end + + it 'has a repository namespace sets to "namespace"' do + expect(subject.repository_namespace).to eq 'namespace' + end + + it 'has a repository name sets to "name"' do + expect(subject.repository_name).to eq 'name' + end +end