Skip to content

Commit

Permalink
fix another test that needed a real folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Jun 25, 2024
1 parent 3023f01 commit d2907e8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions spec/models/model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,17 @@
end

context "when nested inside another with underscores in the name" do
before do
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:exist?).with("/library").and_return(true)
around do |ex|
MockDirectory.create([
"model_one/part.stl",
"model_one/nested_model/part.stl"
]) do |path|
@library_path = path
ex.run
end
end

let(:library) { create(:library, path: "/library") }
let(:library) { create(:library, path: @library_path) } # rubocop:todo RSpec/InstanceVariable
let!(:parent) { create(:model, library: library, path: "model_one") }
let!(:child) { create(:model, library: library, path: "model_one/nested_model") }

Expand Down

0 comments on commit d2907e8

Please sign in to comment.