oktobertest 0.2.0 → 0.3.0

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: b0f9607852623f5f9a4908be8ca040ca863957f5
4
- data.tar.gz: 30f8a2a7b63f07bc9517456982f0aff1d21305e9
3
+ metadata.gz: 7cb35368edf512830d4110c4c069433b1fabb3b4
4
+ data.tar.gz: fd17bfa67fe3cd2ef280c83bb73a9b1c725147fa
5
5
  SHA512:
6
- metadata.gz: ba1563ea9756c73a16ff2d72b9dec43dc380dd3d676a434f6b9c59be6d5d07809635605283206e4902a2e33da96d424e8b2c7cd116f80e6556c930412e282417
7
- data.tar.gz: 3982d6c8217fb4617ed1ec52df46eee4aac4668cd8a567b136cfaa8fbd9ab817987f82fab4de2673eb4e0600157078838b226bf9b225f6765fbb60890cf83dbc
6
+ metadata.gz: de83acb718335476690b83f2f1d08b8d5971d645044286416f62617bea065cad1967d0de7e518d2ff264133b9dbb3d0480e465d0744ede4679e7918f9fc97003
7
+ data.tar.gz: 8e5d77c81b2b9c5edb7341ed242cd1ada37de76d4d2788efab0cb397808ebd7926c54f4a16efcb080e72bb74656de1e3a237836d7f90f013d6cc6f2e065869b0
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  rvm:
3
3
  - 2.0.0
4
- - 2.1.1
4
+ - 2.1.2
5
5
  - ruby-head
6
6
  addons:
7
7
  code_climate:
data/README.md CHANGED
@@ -115,11 +115,11 @@ Using `ruby`:
115
115
  $ ruby -r oktobertest test/*_test.rb
116
116
  ```
117
117
 
118
- When using `ruby` directly, you can specify the scope (`SCOPE`) or the test
119
- (`TEST`) to run:
118
+ When using `ruby` directly, you can specify the scope (`S`) or the test
119
+ (`T`) to run:
120
120
 
121
121
  ```bash
122
- $ TEST='test this' ruby -r oktobertest test/*_test.rb
122
+ $ T='test this' ruby -r oktobertest test/*_test.rb
123
123
  ```
124
124
 
125
125
  ### Testing Rack applications
data/lib/oktobertest.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Oktobertest
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
 
4
4
  TestFailed = Class.new StandardError
5
5
  TestSkipped = Class.new StandardError
@@ -53,7 +53,7 @@ module Oktobertest
53
53
  end
54
54
 
55
55
  def run?
56
- !ENV['SCOPE'] || ENV['SCOPE'] == @name
56
+ !ENV['S'] || ENV['S'] == @name
57
57
  end
58
58
 
59
59
  protected
@@ -106,7 +106,7 @@ module Oktobertest
106
106
  end
107
107
 
108
108
  def run?
109
- !ENV['TEST'] || ENV['TEST'] == @name
109
+ !ENV['T'] || ENV['T'] == @name
110
110
  end
111
111
  end
112
112
  end
data/test/scope_test.rb CHANGED
@@ -10,11 +10,24 @@ scope do
10
10
  assert foo == 'foo'
11
11
  end
12
12
 
13
+ test 'does not respond to bar' do
14
+ assert !respond_to?(:bar)
15
+ end
16
+
13
17
  scope do
18
+ def bar
19
+ 'bar'
20
+ end
21
+
14
22
  test 'responds to foo' do
15
23
  assert respond_to? :foo
16
24
  assert foo == 'foo'
17
25
  end
26
+
27
+ test 'responds to bar' do
28
+ assert respond_to? :bar
29
+ assert bar == 'bar'
30
+ end
18
31
  end
19
32
  end
20
33
 
@@ -53,3 +66,17 @@ scope do
53
66
  assert @bar.nil?
54
67
  end
55
68
  end
69
+
70
+ scope do
71
+ def foo
72
+ 'foo'
73
+ end
74
+
75
+ setup do
76
+ @foo = foo
77
+ end
78
+
79
+ test 'foo is defined' do
80
+ assert @foo == 'foo'
81
+ end
82
+ end
data/test/setup_test.rb CHANGED
@@ -40,7 +40,7 @@ scope do
40
40
  @bar = 'bar'
41
41
  end
42
42
 
43
- test 'both foo and bar are defined, but baz is not' do
43
+ test 'foo and bar are defined, but baz is not' do
44
44
  assert @foo == 'foo'
45
45
  assert @bar == 'bar'
46
46
  assert @baz.nil?
@@ -50,7 +50,7 @@ scope do
50
50
  @baz = 'baz'
51
51
  end
52
52
 
53
- test 'both foo, bar and baz are defined' do
53
+ test 'foo, bar and baz are defined' do
54
54
  assert @foo == 'foo'
55
55
  assert @bar == 'bar'
56
56
  assert @baz == 'baz'
@@ -11,5 +11,10 @@ scope do
11
11
 
12
12
  teardown do
13
13
  assert @foo == 'bar'
14
+ @foo == 'baz'
15
+ end
16
+
17
+ teardown do
18
+ assert @foo == 'baz'
14
19
  end
15
20
  end
data/test/test_test.rb ADDED
@@ -0,0 +1,12 @@
1
+ require 'helper'
2
+
3
+ scope do
4
+ test do
5
+ @foo = 'foo'
6
+ assert @foo == 'foo'
7
+ end
8
+
9
+ test '@foo is not defined' do
10
+ assert @foo.nil?
11
+ end
12
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oktobertest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Mac Adden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-01 00:00:00.000000000 Z
11
+ date: 2014-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,6 +79,7 @@ files:
79
79
  - test/scope_test.rb
80
80
  - test/setup_test.rb
81
81
  - test/teardown_test.rb
82
+ - test/test_test.rb
82
83
  homepage: https://github.com/patriciomacadden/oktobertest
83
84
  licenses:
84
85
  - MIT
@@ -116,3 +117,4 @@ test_files:
116
117
  - test/scope_test.rb
117
118
  - test/setup_test.rb
118
119
  - test/teardown_test.rb
120
+ - test/test_test.rb