Skip to content

Commit

Permalink
Jive v0.1.11, @__END__
Browse files Browse the repository at this point in the history
  • Loading branch information
wookay committed May 13, 2019
1 parent 7250473 commit dc99e03
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ keywords = ["distributed", "test"]
license = "MIT"
desc = "some useful steps in tests"
authors = ["WooKyoung Noh <[email protected]>"]
version = "0.1.11-DEV"
version = "0.1.11"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
39 changes: 7 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [@If](#If)
- [@useinside](#useinside)
- [@mockup](#mockup)
- [`@__END__`](#__end__)


# runtests
Expand Down Expand Up @@ -173,42 +174,16 @@ used to produce a replica from the other module.

* [test/jive/mockup](https://github.com/wookay/Jive.jl/blob/master/test/jive/mockup)

```julia
using Jive # Mock @mockup
using Test

module Goods
struct Foo
end
function f(::Foo)
10
end
function g(::Foo)
10
end
end # module Goods
# `@__END__`

`throw(Jive.EndError())`

@mockup module Goods
function f(::Foo)
20
end
end # @mockup module Goods
@test Goods.f(Goods.Foo()) == 10
@test Mock.Goods.f(Mock.Goods.Foo()) == 20
@test Mock.Goods.g(Mock.Goods.Foo()) == 10
* [`test/jive/__END__`](https://github.com/wookay/Jive.jl/blob/master/test/jive/__END__)


Goods3 = @mockup module Goods
function g(::Foo)
30
end
end # @mockup module Goods
@test Goods.f(Goods.Foo()) == 10
@test Mock.Goods.f(Mock.Goods.Foo()) == 10
@test Mock.Goods.g(Mock.Goods.Foo()) == 30
@test Goods3 isa Module
@test Goods3.g === Mock.Goods.g
```julia
using Jive
@__END__
```


Expand Down
53 changes: 14 additions & 39 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

`Jive.jl` is a Julia package to help the writing tests.

- [runtests](#runtests)
- [watch](#watch)
- [@skip](#skip)
- [@onlyonce](#onlyonce)
- [@If](#If)
- [@useinside](#useinside)
- [@mockup](#mockup)
- [runtests](#runtests-1)
- [watch](#watch-1)
- [@skip](#@skip-1)
- [@onlyonce](#@onlyonce-1)
- [@If](#@If-1)
- [@useinside](#@useinside-1)
- [@mockup](#@mockup-1)
- [`@__END__`](#@__END__-1)


# runtests
Expand Down Expand Up @@ -162,40 +163,14 @@ used to produce a replica from the other module.

* [test/jive/mockup](https://github.com/wookay/Jive.jl/blob/master/test/jive/mockup)

```julia
using Jive # Mock @mockup
using Test

module Goods
struct Foo
end
function f(::Foo)
10
end
function g(::Foo)
10
end
end # module Goods
# `@__END__`

`throw(Jive.EndError())`

@mockup module Goods
function f(::Foo)
20
end
end # @mockup module Goods
@test Goods.f(Goods.Foo()) == 10
@test Mock.Goods.f(Mock.Goods.Foo()) == 20
@test Mock.Goods.g(Mock.Goods.Foo()) == 10
* [`test/jive/__END__`](https://github.com/wookay/Jive.jl/blob/master/test/jive/__END__)


Goods3 = @mockup module Goods
function g(::Foo)
30
end
end # @mockup module Goods
@test Goods.f(Goods.Foo()) == 10
@test Mock.Goods.f(Mock.Goods.Foo()) == 10
@test Mock.Goods.g(Mock.Goods.Foo()) == 30
@test Goods3 isa Module
@test Goods3.g === Mock.Goods.g
```julia
using Jive
@__END__
```

0 comments on commit dc99e03

Please sign in to comment.