spec/rflow/component/port_spec.rb in rflow-1.0.0a2 vs spec/rflow/component/port_spec.rb in rflow-1.0.0a3
- old
+ new
@@ -2,58 +2,52 @@
class RFlow
class Component
describe Port do
it "should not be connected" do
- described_class.new.should_not be_connected
+ expect(described_class.new(nil)).not_to be_connected
end
end
describe HashPort do
it "should not be connected" do
- config = double('Port Config')
- config.stub(:name).and_return('port')
- config.stub(:uuid).and_return('1')
-
- described_class.new(config).should_not be_connected
+ expect(described_class.new(nil)).not_to be_connected
end
end
describe InputPort do
context "#connect!" do
it "should be connected" do
connection = double('connection')
- connection.should_receive(:connect_input!)
+ allow(connection).to receive(:name)
+ allow(connection).to receive(:uuid)
+ allow(connection).to receive(:input_port_key)
+ expect(connection).to receive(:connect_input!)
- config = double('Port Config')
- config.stub(:name).and_return('port')
- config.stub(:uuid).and_return('1')
-
- described_class.new(config).tap do |port|
+ described_class.new(nil).tap do |port|
port.add_connection(nil, connection)
- port.should_not be_connected
+ expect(port).not_to be_connected
port.connect!
- port.should be_connected
+ expect(port).to be_connected
end
end
end
end
describe OutputPort do
context "#connect!" do
it "should be connected" do
connection = double('connection')
- connection.should_receive(:connect_output!)
+ allow(connection).to receive(:name)
+ allow(connection).to receive(:uuid)
+ allow(connection).to receive(:input_port_key)
+ expect(connection).to receive(:connect_output!)
- port_config = double('Port Config')
- port_config.stub(:name).and_return('port')
- port_config.stub(:uuid).and_return('1')
-
- described_class.new(port_config).tap do |port|
+ described_class.new(nil).tap do |port|
port.add_connection(nil, connection)
- port.should_not be_connected
+ expect(port).not_to be_connected
port.connect!
- port.should be_connected
+ expect(port).to be_connected
end
end
end
end
end