       exec "gobgp global rib -a ipv4-flowspec add #{FLOWSPEC_PREFIX}"
       expect(flowspec_rib()).not.to.be.empty
 
-      gobgp.deletePath family: 'ipv4-flowspec', FLOWSPEC_PREFIX
-
-      expect(flowspec_rib()).to.be.empty
+      gobgp.deletePath family: 'ipv4-flowspec', FLOWSPEC_PREFIX, ->
+        expect(flowspec_rib()).to.be.empty
 
 
   describe 'backward compatibility for modPath', ->
     it 'originates a route', ->
       expect(global_rib()).to.be.empty
 
-      gobgp.modPath family: 'ipv4-unicast', PREFIX
-
-      prefixes = global_rib(PREFIX)
-      expect(prefixes.length).to.equal 1
+      gobgp.modPath family: 'ipv4-unicast', PREFIX, ->
+        prefixes = global_rib(PREFIX)
+        expect(prefixes.length).to.equal 1
 
     it 'withdraws a route', ->
       exec "gobgp global rib add #{PREFIX}"
       expect(global_rib()).not.to.be.empty
 
-      gobgp.modPath family: 'ipv4-unicast', withdraw: true, PREFIX
-
-      expect(global_rib()).to.be.empty
+      gobgp.modPath family: 'ipv4-unicast', withdraw: true, PREFIX, ->
+        expect(global_rib()).to.be.empty

      exec "gobgp global rib add #{PREFIX}"
      expect(global_rib()).not.to.be.empty

      gobgp.deletePath family: 'ipv4-unicast', PREFIX

      expect(global_rib()).to.be.empty


  describe 'family ipv4-flowspec', ->
    it 'originates a route', ->
      expect(flowspec_rib()).to.be.empty

      gobgp.addPath family: 'ipv4-flowspec', FLOWSPEC_PREFIX

      prefixes = flowspec_rib(FLOWSPEC_JSON_PREFIX)
      expect(prefixes.length).to.equal 1

    it 'shows the RIB', ->  # TODO: This does actually nothing. Use chai-as-promised
      exec "gobgp global rib -a ipv4-flowspec add #{FLOWSPEC_PREFIX}"

    it 'originates a route', ->
      expect(global_rib()).to.be.empty

      gobgp.addPath family: 'ipv4-unicast', PREFIX, ->
        prefixes = global_rib(PREFIX)
        expect(prefixes.length).to.equal 1

    it 'originates a route with BGP community string', ->
      expect(global_rib()).to.be.empty

      gobgp.addPath family: 'ipv4-unicast', "#{PREFIX} community no-advertise", ->
        prefixes = global_rib(PREFIX)
        expect(prefixes.length).to.equal 1

        expect(communities(PREFIX)).to.eql [4294967042]

    it 'originates a route with BGP community byte array', ->
      expect(global_rib()).to.be.empty
