pork 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e51ae61ad2d2b0d608bdb753560c3cc2294cd1d
4
- data.tar.gz: ca7c3abfecf2f801008cd1b9583abd4dcb8eaed4
3
+ metadata.gz: b60799f58ae3ada9e2e21aac7abd1976b58fc4a5
4
+ data.tar.gz: d164b9472b6172aa706d5b0277e76973f72d442c
5
5
  SHA512:
6
- metadata.gz: 0f03bec4e90ae00a3da243db950cf9874990c80fd0bdafc83f97e7e5f1770db8e1b4c3a80af77f70822214e88fadff79c11e056d521ef03c2dddf41222c9ae89
7
- data.tar.gz: c79774e3e1d78c1ccc8f0ca5f5765b8ee632ab929d260f36353cafaffdb4289955e3bc81fec7e77b9fc7e2513091772612166d79787cc33743d8f8d409c83cf6
6
+ metadata.gz: 976ed47455385545294100c395a7eae919bf05817abe3d28ece08c123160fe6cc76a41e2d6ee41b40cd53520ef163b0c9f91355a474ad75cfd98dd4b00afc2fe
7
+ data.tar.gz: e5829c79dad56585a2fd33e74dab2692d6ece7261de31d53e6428da3fdad1cac47287f361205221f3840ab7edd79129e17738e57793d10e5981bf89fc4deaf50
data/CHANGES.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # CHANGES
2
2
 
3
+ ## Pork 1.3.1 -- 2015-06-06
4
+
5
+ ### Enhancement
6
+
7
+ * Added `pork_description` in the test case so that we could access the
8
+ description for the running test case. To access the full message,
9
+ use `self.class.send(:description_for, "would: #{pork_description}")`.
10
+ Note that this is not a public API yet, and is subject to change.
11
+
3
12
  ## Pork 1.3.0 -- 2015-05-24
4
13
 
5
14
  ### Incompatible changes
6
15
 
7
16
  * `Pork.run` is renamed to `Pork.execute`,
8
17
  and `Pork.run` would now do a full run.
9
-
10
18
  * `Pork::Executor.all_tests` would also include paths to describe blocks.
11
19
 
12
20
  ### Enhancement
@@ -34,7 +42,7 @@
34
42
 
35
43
  ### Enhancement
36
44
 
37
- * Now `would` could take a second argument with `:group => [:name]`,
45
+ * Now `would` could take a second argument with `:groups => [:name]`,
38
46
  and you could also specifying the groups to run in `PORK_TEST`.
39
47
  Checkout README for more information. Input from @mz026
40
48
 
data/lib/pork/executor.rb CHANGED
@@ -3,7 +3,7 @@ require 'pork/imp'
3
3
  require 'pork/context'
4
4
 
5
5
  module Pork
6
- class Executor < Struct.new(:pork_stat)
6
+ class Executor < Struct.new(:pork_stat, :pork_description)
7
7
  extend Imp
8
8
  include Context
9
9
  init
data/lib/pork/imp.rb CHANGED
@@ -43,10 +43,10 @@ module Pork
43
43
  @super_executor = ancestors[1..-1].find{ |a| a <= Executor }
44
44
  end
45
45
 
46
- def run desc, test, stat, env
46
+ def run stat, desc, test, env
47
47
  assertions = stat.assertions
48
- context = new(stat)
49
- run_protected(desc, stat, test) do
48
+ context = new(stat, desc)
49
+ run_protected(stat, desc, test) do
50
50
  env.run_before(context)
51
51
  context.instance_eval(&test)
52
52
  if assertions == stat.assertions
@@ -56,10 +56,10 @@ module Pork
56
56
  end
57
57
  ensure
58
58
  stat.incr_tests
59
- run_protected(desc, stat, test){ env.run_after(context) }
59
+ run_protected(stat, desc, test){ env.run_after(context) }
60
60
  end
61
61
 
62
- def run_protected desc, stat, test
62
+ def run_protected stat, desc, test
63
63
  yield
64
64
  rescue Error, StandardError => e
65
65
  case e
@@ -14,7 +14,7 @@ module Pork
14
14
  when :describe
15
15
  arg.sequential(stat, env)
16
16
  when :would
17
- run(arg, test, stat, env)
17
+ run(stat, arg, test, env)
18
18
  end
19
19
  end
20
20
 
@@ -57,7 +57,7 @@ module Pork
57
57
 
58
58
  if path.size == 1
59
59
  _, desc, test = @tests[idx]
60
- run(desc, test, stat, env)
60
+ run(stat, desc, test, env)
61
61
  else
62
62
  @tests[idx][1].isolate(stat, path.drop(1), env)
63
63
  end
data/lib/pork/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Pork
3
- VERSION = '1.3.0'
3
+ VERSION = '1.3.1'
4
4
  end
data/pork.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: pork 1.3.0 ruby lib
2
+ # stub: pork 1.3.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "pork"
6
- s.version = "1.3.0"
6
+ s.version = "1.3.1"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["Lin Jen-Shin (godfat)"]
11
- s.date = "2015-05-24"
11
+ s.date = "2015-06-06"
12
12
  s.description = "Pork -- Simple and clean and modular testing library.\n\nInspired by [Bacon][].\n\n[Bacon]: https://github.com/chneukirchen/bacon"
13
13
  s.email = ["godfat (XD) godfat.org"]
14
14
  s.files = [
data/test/test_nested.rb CHANGED
@@ -72,3 +72,9 @@ describe 'should(message)' do
72
72
  end.message.should.eq "Expect qoo\nnnf"
73
73
  end
74
74
  end
75
+
76
+ describe Pork::Context do
77
+ would(desc = rand) do
78
+ expect(pork_description).eq desc
79
+ end
80
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin Jen-Shin (godfat)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-24 00:00:00.000000000 Z
11
+ date: 2015-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source