Sha256: 0c266e881548f2633853c66964f9ff7e67092dc891f5a29eeaba2fb7d8a40823

Contents?: true

Size: 988 Bytes

Versions: 29

Compression:

Stored size: 988 Bytes

Contents

riml_include 'dsl.riml'

class AfterHookSpec
  defm describe
    return 'After hooks'
  end

  defm before
    self.stuff = 'foo'
  end

  defm it_adds_more_stuff
    self.more_stuff = 'bar'
    expect(self.stuff).to_equal('foo')
  end

  defm after
    unless self.stuff == 'foo'
      throw 'before hook not called'
    end
    unless self.more_stuff == 'bar'
      throw 'after called before test'
    end
  end
end

class AfterEachHookSpec
  defm describe
    return 'After_each hooks'
  end

  defm before
    self.stuff = 'foo'
  end

  defm it_adds_some_more_stuff
    self.more_stuff = 'bar'
    expect(self.stuff).to_equal('foo')
  end

  defm after_each
    unless self.stuff == 'foo'
      throw 'before hook not called'
    end
    unless self.more_stuff == 'bar'
      throw 'after called before test'
    end

    self.even_more_stuff = 'foobar'
  end

  defm after
    unless self.even_more_stuff == 'foobar'
      throw 'after_each called before after'
    end
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
speckle-0.2.0 spec/after_hooks_spec.riml
speckle-0.1.31 spec/after_hooks_spec.riml
speckle-0.1.30 spec/after_hooks_spec.riml
speckle-0.1.29 spec/after_hooks_spec.riml
speckle-0.1.28 spec/after_hooks_spec.riml
speckle-0.1.27 spec/after_hooks_spec.riml
speckle-0.1.26 spec/after_hooks_spec.riml
speckle-0.1.25 spec/after_hooks_spec.riml
speckle-0.1.24 spec/after_hooks_spec.riml
speckle-0.1.23 spec/after_hooks_spec.riml
speckle-0.1.22 spec/after_hooks_spec.riml
speckle-0.1.21 spec/after_hooks_spec.riml
speckle-0.1.20 spec/after_hooks_spec.riml
speckle-0.1.19 spec/after_hooks_spec.riml
speckle-0.1.18 spec/after_hooks_spec.riml
speckle-0.1.17 spec/after_hooks_spec.riml
speckle-0.1.16 spec/after_hooks_spec.riml
speckle-0.1.15 spec/after_hooks_spec.riml
speckle-0.1.14 spec/after_hooks_spec.riml
speckle-0.1.13 spec/after_hooks_spec.riml