diff --git a/spec/bundle_spec.rb b/spec/bundle_spec.rb index d3340687f..89c662b2a 100644 --- a/spec/bundle_spec.rb +++ b/spec/bundle_spec.rb @@ -5,14 +5,6 @@ let(:revs) { bundle_setup(:proj_revs) } let(:rumsey) { bundle_setup(:proj_rumsey) } - def bundle_setup(proj) - filename = "spec/test_data/project_config_files/#{proj}.yaml" - @ps = YAML.load(File.read(filename)) - @ps['config_filename'] = filename - @ps['show_progress'] = false - PreAssembly::Bundle.new(@ps) - end - describe "initialize() and other setup" do it "trims the trailing slash from the bundle directory" do expect(revs.bundle_dir).to eq('spec/test_data/bundle_input_a') @@ -562,9 +554,8 @@ def bundle_setup(proj) expect(b.progress_log_file).to eq('spec/test_data/project_config_files/proj_sohp3_progress.yaml') end - it "sets the content_tag_override to the default value when not specified" do + it "sets content_tag_override to the default value when not specified" do expect(revs.project_style[:content_tag_override]).to be_falsey - expect(@ps['project_style'][:content_tag_override]).to be_nil end it "sets the staging_dir to the default value if not specified in the YAML" do diff --git a/spec/support/bundle_setup.rb b/spec/support/bundle_setup.rb new file mode 100644 index 000000000..e8beba230 --- /dev/null +++ b/spec/support/bundle_setup.rb @@ -0,0 +1,9 @@ +# @param [#to_s] proj basename of YAML fixture file +# @return [PreAssembly::Bundle] +def bundle_setup(proj) + filename = "spec/test_data/project_config_files/#{proj}.yaml" + ps = YAML.load(File.read(filename)) + ps['config_filename'] = filename + ps['show_progress'] = false + PreAssembly::Bundle.new(ps) +end