spec/lib/appsignal/hooks/data_mapper_spec.rb in appsignal-2.1.0.beta.1 vs spec/lib/appsignal/hooks/data_mapper_spec.rb in appsignal-2.1.0

- old
+ new

@@ -1,31 +1,39 @@ describe Appsignal::Hooks::DataMapperHook do context "with datamapper" do - before :all do + before :context do module DataMapper end module DataObjects class Connection end end Appsignal::Hooks::DataMapperHook.new.install end - after :all do + after :context do Object.send(:remove_const, :DataMapper) Object.send(:remove_const, :DataObjects) end - its(:dependencies_present?) { should be_true } + describe "#dependencies_present?" do + subject { described_class.new.dependencies_present? } + it { is_expected.to be_truthy } + end + it "should install the listener" do expect(::DataObjects::Connection).to receive(:include) .with(Appsignal::Hooks::DataMapperLogListener) Appsignal::Hooks::DataMapperHook.new.install end end context "without datamapper" do - its(:dependencies_present?) { should be_false } + describe "#dependencies_present?" do + subject { described_class.new.dependencies_present? } + + it { is_expected.to be_falsy } + end end end