Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
floriandejonckheere committed Apr 26, 2024
1 parent 2217c0a commit e5e88cc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/mosaik/graph/visualizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def to_dot
.clusters
.values
.filter_map do |cluster|
next if options[:show_uncoupled] || (cluster.vertices.empty? || cluster.vertices.all? { |vertex| vertex.edges.empty? })
next unless options[:show_uncoupled] || (cluster.vertices.any? { |vertex| vertex.edges.any? })

[
"subgraph \"#{cluster.id}\" {",
Expand Down
2 changes: 2 additions & 0 deletions spec/mosaik/commands/identify_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
let(:arguments) { ["--algorithm", "invalid"] }

it "raises an error" do
FileUtils.touch("mosaik-candidates.csv")

expect { command.validate }.to raise_error MOSAIK::OptionError, "unknown algorithm: invalid"
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/mosaik/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
end

it "sets the includes attribute" do
expect(described_class.from(file).includes).to eq ["**/*.{rb,rake,erb}"]
expect(described_class.from(file).includes).to eq ["**/*.rb"]
end

it "sets the excludes attribute" do
Expand Down
4 changes: 2 additions & 2 deletions spec/mosaik/graph/visualizer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
end

context "when uncoupled vertices are hidden" do
let(:options) { { show_uncoupled: false } }
let(:options) { { show_uncoupled: false, show_labels: true } }

it "returns the graph in DOT format" do
graph.add_vertex("vertex1")
Expand All @@ -130,7 +130,7 @@
end

context "when labels are hidden" do
let(:options) { { show_labels: false } }
let(:options) { { show_uncoupled: true, show_labels: false } }

it "returns the graph in DOT format" do
graph.add_vertex("vertex1")
Expand Down

0 comments on commit e5e88cc

Please sign in to comment.