Skip to content

Commit 8ceb7cd

Browse files
committed
update specs to reduce examples
1 parent 34126cb commit 8ceb7cd

File tree

3 files changed

+0
-106
lines changed

3 files changed

+0
-106
lines changed

spec/mars/aggregator_spec.rb

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe Mars::Aggregator do
4-
describe "#initialize" do
5-
it "initializes with a default name" do
6-
aggregator = described_class.new
7-
expect(aggregator.name).to eq("Aggregator")
8-
end
9-
10-
it "initializes with a custom name" do
11-
aggregator = described_class.new("CustomAggregator")
12-
expect(aggregator.name).to eq("CustomAggregator")
13-
end
14-
end
15-
16-
describe "#name" do
17-
it "returns the aggregator name" do
18-
aggregator = described_class.new("MyAggregator")
19-
expect(aggregator.name).to eq("MyAggregator")
20-
end
21-
end
22-
234
describe "#run" do
245
let(:aggregator) { described_class.new }
256

@@ -66,10 +47,4 @@
6647
end
6748
end
6849
end
69-
70-
describe "inheritance" do
71-
it "inherits from Mars::Runnable" do
72-
expect(described_class.ancestors).to include(Mars::Runnable)
73-
end
74-
end
7550
end

spec/mars/exit_spec.rb

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,9 @@
11
# frozen_string_literal: true
22

33
RSpec.describe Mars::Exit do
4-
describe "#initialize" do
5-
it "initializes with a default name" do
6-
exit_node = described_class.new
7-
expect(exit_node.name).to eq("Exit")
8-
end
9-
10-
it "initializes with a custom name" do
11-
exit_node = described_class.new(name: "CustomExit")
12-
expect(exit_node.name).to eq("CustomExit")
13-
end
14-
end
15-
16-
describe "#name" do
17-
it "returns the exit name" do
18-
exit_node = described_class.new(name: "MyExit")
19-
expect(exit_node.name).to eq("MyExit")
20-
end
21-
end
22-
234
describe "#run" do
245
let(:exit_node) { described_class.new }
256

26-
it "returns the input unchanged" do
27-
input = "test input"
28-
result = exit_node.run(input)
29-
expect(result).to eq(input)
30-
end
31-
327
it "works with string inputs" do
338
result = exit_node.run("hello")
349
expect(result).to eq("hello")
@@ -55,17 +30,5 @@
5530
result = exit_node.run(nil)
5631
expect(result).to be_nil
5732
end
58-
59-
it "returns the exact same object (not a copy)" do
60-
input = "test"
61-
result = exit_node.run(input)
62-
expect(result).to be(input)
63-
end
64-
end
65-
66-
describe "inheritance" do
67-
it "inherits from Mars::Runnable" do
68-
expect(described_class.ancestors).to include(Mars::Runnable)
69-
end
7033
end
7134
end

spec/mars/gate_spec.rb

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe Mars::Gate do
4-
describe "#initialize" do
5-
let(:condition) { ->(input) { input > 5 } }
6-
let(:branches) { { true => Mars::Exit.new, false => Mars::Exit.new } }
7-
8-
it "initializes with required parameters" do
9-
gate = described_class.new(name: "TestGate", condition: condition, branches: branches)
10-
expect(gate.name).to eq("TestGate")
11-
end
12-
13-
it "requires a name parameter" do
14-
expect do
15-
described_class.new(condition: condition, branches: branches)
16-
end.to raise_error(ArgumentError)
17-
end
18-
19-
it "requires a condition parameter" do
20-
expect do
21-
described_class.new(name: "TestGate", branches: branches)
22-
end.to raise_error(ArgumentError)
23-
end
24-
25-
it "requires a branches parameter" do
26-
expect do
27-
described_class.new(name: "TestGate", condition: condition)
28-
end.to raise_error(ArgumentError)
29-
end
30-
end
31-
32-
describe "#name" do
33-
let(:condition) { ->(input) { input > 5 } }
34-
let(:branches) { { true => Mars::Exit.new } }
35-
36-
it "returns the gate name" do
37-
gate = described_class.new(name: "MyGate", condition: condition, branches: branches)
38-
expect(gate.name).to eq("MyGate")
39-
end
40-
end
41-
424
describe "#run" do
435
context "with simple boolean condition" do
446
let(:condition) { ->(input) { input > 5 } }
@@ -175,10 +137,4 @@
175137
end
176138
end
177139
end
178-
179-
describe "inheritance" do
180-
it "inherits from Mars::Runnable" do
181-
expect(described_class.ancestors).to include(Mars::Runnable)
182-
end
183-
end
184140
end

0 commit comments

Comments
 (0)