eetee 0.0.8 → 0.0.9

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: 490ebe9116eabdb5793ae2348327d840d593ba2d
4
- data.tar.gz: 14f9bd2c7fad97bff8216697b6e430d8a04ad674
3
+ metadata.gz: 9b5cc3da9d9d6f2285d3d5321517d3575ff1f9dd
4
+ data.tar.gz: 2ccbd24a3dc47b488ece2007763f192d35bb4d4e
5
5
  SHA512:
6
- metadata.gz: e379722726d5df42376728dbf32160258dc415a5641e1cb254173e93ec72eaf0d26175d4677c72808b451af004afabf254ce1301cec6684b34af59e649b43c1b
7
- data.tar.gz: 3ee1019f50b7521d4b82fa199d25455e24b39869064b7061debf4001664873684afa9fec5253bbe7c6fe8acecf9bcb068c61f231fc46088ba023486d170645be
6
+ metadata.gz: 56367f2b0ced41f7f6b0e86b265b4dd73343d7a7ff10576d4519bdc94b26a61770d215493d94b5d4faddae1bfce3e04502fcb1c518041111e8ec69bb4f84fd04
7
+ data.tar.gz: e74e9932bb10d3bee96dab690a01912ce34c772392791f00b413dd8c899b0352a9d194199cee4d23cb7d25e0ba03fa34cc99ee3b3cd04e3a5694738d8e202b67
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  bundler_args: --without development
2
2
  rvm:
3
+ - 2.0.0
3
4
  - 1.9.3
4
5
  - rbx-19mode
5
6
 
data/Gemfile CHANGED
@@ -4,6 +4,11 @@ gemspec
4
4
 
5
5
  gem 'rake'
6
6
 
7
+ group(:development) do
8
+ gem 'rblineprof'
9
+ gem 'rb-blink1'
10
+ end
11
+
7
12
  group(:test) do
8
13
  gem 'mocha', '~> 0.12.0'
9
14
 
@@ -13,5 +18,4 @@ group(:test) do
13
18
  gem 'growl'
14
19
 
15
20
  gem 'eventmachine', '~> 1.0.0'
16
- gem 'rb-blink1'
17
21
  end
data/eetee.gemspec CHANGED
@@ -16,5 +16,5 @@ Gem::Specification.new do |gem|
16
16
 
17
17
  gem.required_ruby_version = '>= 1.9.3'
18
18
 
19
- gem.add_dependency 'term-ansicolor', '~> 1.0.7'
19
+ gem.add_dependency 'term-ansicolor', '~> 1.1'
20
20
  end
@@ -8,6 +8,11 @@ include EEtee
8
8
  shared(:valid_object) do |obj, n|
9
9
  should 'receive correct number' do
10
10
  n.should == 42
11
+ obj.should == 'string'
12
+ end
13
+
14
+ should 'receive correct string' do
15
+ obj.should == 'string'
11
16
  end
12
17
 
13
18
  should 'respond to :to_i' do
@@ -24,11 +29,9 @@ end
24
29
 
25
30
  describe 'Tests' do
26
31
  before do
27
- @obj = "string"
32
+ # clear database
28
33
  end
29
34
 
30
- in_scope do
31
- run_shared(:valid_object, @obj, 42)
32
- end
35
+ run_shared(:valid_object, 'string', 42)
33
36
 
34
37
  end
@@ -100,7 +100,8 @@ module EEtee
100
100
  err = ex
101
101
  end
102
102
 
103
- if err || @invert
103
+ # if (!@invert && err) || (@invert && !err)
104
+ if (@invert ^ err)
104
105
  ::Kernel.raise AssertionFailed.new(@invert ? invert_message : message)
105
106
  end
106
107
 
data/lib/eetee/context.rb CHANGED
@@ -33,15 +33,23 @@ module EEtee
33
33
  end
34
34
 
35
35
  def it(label, opts = {}, &block)
36
+ in_scope(opts) do
37
+ Test.new(label, @_reporter, &block)
38
+ end
39
+ end
40
+
41
+ private
42
+ def in_scope(opts = {})
36
43
  if !@_focus_mode || opts[:focus]
37
44
  begin
38
45
  (@before || []).each{|b| instance_eval(&b) }
39
- Test.new(label, @_reporter, &block)
46
+ yield()
40
47
  ensure
41
48
  (@after || []).each{|b| instance_eval(&b) }
42
49
  end
43
50
  end
44
51
  end
52
+
45
53
  end
46
54
 
47
55
  class Context
@@ -83,13 +91,11 @@ module EEtee
83
91
  end
84
92
 
85
93
  def run_shared(name, *args)
86
- Shared.run(name, @_reporter, @_level, *args)
87
- end
88
-
89
- def in_scope(&block)
90
- instance_eval(&block)
94
+ in_scope do
95
+ Shared.run(name, @_reporter, @_level, *args)
96
+ end
91
97
  end
92
-
98
+
93
99
  end
94
100
 
95
101
  end
@@ -0,0 +1,21 @@
1
+
2
+ module EEteeDisableGC
3
+ def run(&block)
4
+ if toplevel
5
+ GC.disable
6
+ end
7
+
8
+ super
9
+
10
+ if toplevel
11
+ GC.enable()
12
+ GC.start()
13
+ end
14
+ end
15
+
16
+ end
17
+
18
+ puts "GC disabled during tests"
19
+
20
+
21
+ EEtee::Context.__send__(:include, EEteeDisableGC)
data/lib/eetee/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EEtee
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -98,6 +98,14 @@ describe 'AssertionWrapper' do
98
98
  ->{ @wrapper.to_zebra }.should.not.raise(RuntimeError)
99
99
  end
100
100
  end
101
+
102
+ should '[inverted] not raise an error if block raises no error' do
103
+ @obj.expects(:to_zebra).returns(3)
104
+ ensure_error_not_raised do
105
+ ->{ @wrapper.to_zebra }.should.not.raise
106
+ end
107
+ end
108
+
101
109
 
102
110
  end
103
111
 
@@ -37,6 +37,18 @@ describe 'Context' do
37
37
  a.should == 234
38
38
  end
39
39
 
40
+ should 'run arbitrary code in same context' do
41
+ a = nil
42
+ Thread.new do
43
+ EEtee::Context.new("a context", 0, @reporter) do
44
+ before{ @a = 42 }
45
+ # should("do nothing"){} # just to run the before block
46
+ in_scope{ a = @a }
47
+ end
48
+ end.join
49
+ a.should == 42
50
+ end
51
+
40
52
  should 'allow tests to use the context description' do
41
53
  a = nil
42
54
  Thread.new do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eetee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Ammous
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-12 00:00:00.000000000 Z
11
+ date: 2013-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.7
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.7
26
+ version: '1.1'
27
27
  description: Test framework inspired by Bacon
28
28
  email:
29
29
  - schmurfy@gmail.com
@@ -51,6 +51,7 @@ files:
51
51
  - lib/eetee/errors.rb
52
52
  - lib/eetee/ext/em.rb
53
53
  - lib/eetee/ext/mocha.rb
54
+ - lib/eetee/ext/no_gc.rb
54
55
  - lib/eetee/ext/rack.rb
55
56
  - lib/eetee/ext/time.rb
56
57
  - lib/eetee/reporter.rb