spec/lib/dispatch-rider/publisher/configuration_spec.rb in dispatch-rider-1.5.3 vs spec/lib/dispatch-rider/publisher/configuration_spec.rb in dispatch-rider-1.6.0
- old
+ new
@@ -29,27 +29,27 @@
}
}
}
end
- subject{ described_class.new(configuration_hash) }
+ subject { described_class.new(configuration_hash) }
describe "#notification services" do
let(:file_system) do
DispatchRider::Publisher::Configuration::NotificationService.new(
"file_system",
- { "default_folder" => "tmp/dispatch_rider" }
+ "default_folder" => "tmp/dispatch_rider"
)
end
let(:sns) do
DispatchRider::Publisher::Configuration::NotificationService.new("aws_sns", {})
end
it "contains both notification services" do
- subject.notification_services.count.should == 2
- subject.notification_services.should =~ [file_system, sns]
+ expect(subject.notification_services.count).to eq(2)
+ expect(subject.notification_services).to match_array([file_system, sns])
end
end
describe "#destinations" do
let(:employee_updates) do
@@ -79,24 +79,24 @@
}
)
end
it "contains both destinations" do
- subject.destinations.count.should == 2
- subject.destinations.should =~ [employee_updates, account_updates]
+ expect(subject.destinations.count).to eq(2)
+ expect(subject.destinations).to match_array([employee_updates, account_updates])
end
end
describe "#clear" do
example do
- expect{
+ expect {
subject.clear
}.to change(subject.notification_services, :count).by(-2)
end
example do
- expect{
+ expect {
subject.clear
}.to change(subject.destinations, :count).by(-2)
end
end
@@ -134,16 +134,16 @@
before :each do
subject.parse(new_configuration_hash)
end
it "replaces the current notification services with the new notification service" do
- subject.notification_services.count.should == 1
- subject.notification_services.should =~ [notification_service]
+ expect(subject.notification_services.count).to eq(1)
+ expect(subject.notification_services).to match_array([notification_service])
end
it "replaces the current destinations with the new destination" do
- subject.destinations.count.should == 1
- subject.destinations.should =~ [destination]
+ expect(subject.destinations.count).to eq(1)
+ expect(subject.destinations).to match_array([destination])
end
end
end