Skip to content

Commit

Permalink
Remove last instance variable in bundle_spec
Browse files Browse the repository at this point in the history
Breakout method to a `support` file (will be reused elsewhere).
  • Loading branch information
atz committed Aug 27, 2018
1 parent d655c3c commit c932d13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
11 changes: 1 addition & 10 deletions spec/bundle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions spec/support/bundle_setup.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c932d13

Please sign in to comment.