This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple spec for logical coupling extraction
- Loading branch information
1 parent
1b109af
commit 8871075
Showing
3 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.shared_context "with a git repository" do | ||
let(:directory) { Dir.mktmpdir } | ||
let(:git) { Git.init(directory) } | ||
|
||
let(:configuration) { MOSAIK::Configuration.from(File.join(directory, "mosaik.yml")) } | ||
|
||
before do | ||
# Setup the repository with initial commit | ||
File.write(File.join(directory, "README.md"), "# Test Repository") | ||
git.add | ||
git.commit("Initial commit", author: "Author 1 <[email protected]>") | ||
|
||
# Add MOSAIK configuration | ||
FileUtils.cp(MOSAIK.root.join("config/mosaik.yml"), File.join(directory, "mosaik.yml")) | ||
git.add | ||
git.commit("Add MOSAIK configuration", author: "Author 1 <[email protected]>") | ||
|
||
# Add application structure | ||
FileUtils.mkdir(File.join(directory, "lib")) | ||
File.write(File.join(directory, "lib/app.rb"), "class App; end") | ||
git.add | ||
git.commit("Set up application structure", author: "Author 1 <[email protected]>") | ||
|
||
# Add classes | ||
FileUtils.mkdir(File.join(directory, "lib", "app")) | ||
File.write(File.join(directory, "lib/app/foo.rb"), "class App::Foo; end") | ||
File.write(File.join(directory, "lib/app/bar.rb"), "class App::Bar; end") | ||
git.add | ||
git.commit("Set up application structure", author: "Author 1 <[email protected]>") | ||
|
||
# Mock the configuration | ||
allow(MOSAIK) | ||
.to receive(:configuration) | ||
.and_return configuration | ||
end | ||
|
||
after do | ||
# Cleanup the temporary directory | ||
FileUtils.remove_entry(directory) | ||
end | ||
end |