declare 0.0.6 → 0.1.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
- SHA1:
3
- metadata.gz: d0b7b2393e350570e15fc8501a9aac18f508ab36
4
- data.tar.gz: baa99a30e4678a106fb79d9c5ac505b3deb8c71e
2
+ SHA256:
3
+ metadata.gz: fb3560b2ce758a605e41a512cb194a258dc43754c1c4dfcf3e71a07bf25ba724
4
+ data.tar.gz: bab5f9a0dada93af8fd63ae7bcc82bd5c2ec1b4b1ab530418c8c57685670ec3b
5
5
  SHA512:
6
- metadata.gz: 89cd99b192040622f3a99b4ba977c6c9c7fe351d14b6500c536035d6460476b2022e97faf12971518645c21c3c100e04d13d4a1c4ddef53324424930019f03eb
7
- data.tar.gz: 6873af2d3b93edeb50a787a5f0e59bfad36a29bcdd50fdf880761d8f9ad08bda2105011e8cca0cc28f10b2bbcfb729716535dd449887abe5b828dd832e1e9b1c
6
+ metadata.gz: 17a8fa26d4b6e08441a1a0bce5eb10a3e4ad0e95318b4ed1601dc3d91559c05a1fda0efaf923b9a74118b44c1653b60be6eeedbfbd782b6635cfa9264a9247e2
7
+ data.tar.gz: 16c4dcf92cb13aa099f9dc6d01a53ea0e8ef6300683bfb56838c90a49ac608e9f63f3eb7d8065e9547b53fb0f709d1d7a65206411da1cc8151164c2fecb63780
@@ -1,19 +1,18 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
+ - 2.4
5
+ - 2.3
6
+ - 2.2
4
7
  - ruby-head
5
- - 2.0.0
6
- - 1.9.3
7
- - rbx
8
+ - rbx-3
8
9
  - jruby-head
9
- - jruby-19mode
10
10
 
11
11
  matrix:
12
12
  allow_failures:
13
13
  - rvm: ruby-head
14
- - rvm: rbx
14
+ - rvm: rbx-3
15
15
  - rvm: jruby-head
16
- - rvm: jruby-19mode
17
16
 
18
17
  before_install:
19
- - gem install bundler
18
+ - gem install bundler
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  declare
2
2
  =======
3
3
 
4
+ [![Build Status](https://secure.travis-ci.org/kachick/declare.png)](http://travis-ci.org/kachick/declare)
5
+ [![Gem Version](https://badge.fury.io/rb/declare.png)](http://badge.fury.io/rb/declare)
6
+
4
7
  Description
5
8
  ------------
6
9
 
@@ -23,7 +26,7 @@ Product Code
23
26
  ```ruby
24
27
  class Person
25
28
  attr_reader :name, :birth
26
-
29
+
27
30
  def initialize(name)
28
31
  @name = name
29
32
  @birth = Time.now
@@ -41,9 +44,9 @@ The Person.new('John') do |john|
41
44
  can :birth
42
45
  is_a Person
43
46
  kind_of Object
44
-
47
+
45
48
  NOT 'Taro'
46
-
49
+
47
50
  The john.name do |name|
48
51
  kind_of String
49
52
  is_a 'Taro'
@@ -95,7 +98,7 @@ require 'declare/autorun'
95
98
  Requirements
96
99
  -------------
97
100
 
98
- * Ruby - [1.9.3 or later](http://travis-ci.org/#!/kachick/declare)
101
+ * Ruby - [2.2 or later](http://travis-ci.org/#!/kachick/declare)
99
102
 
100
103
  Install
101
104
  -------
@@ -104,16 +107,11 @@ Install
104
107
  $ gem install declare
105
108
  ```
106
109
 
107
- Build Status
108
- -------------
109
-
110
- [![Build Status](https://secure.travis-ci.org/kachick/declare.png)](http://travis-ci.org/kachick/declare)
111
-
112
110
  Link
113
111
  ----
114
112
 
115
113
  * [code](https://github.com/kachick/declare)
116
- * [API](http://kachick.github.com/declare/yard/frames.html)
114
+ * [API](http://www.rubydoc.info/github/kachick/declare)
117
115
  * [issues](https://github.com/kachick/declare/issues)
118
116
  * [CI](http://travis-ci.org/#!/kachick/declare)
119
117
  * [gem](https://rubygems.org/gems/declare)
@@ -10,15 +10,14 @@ Gem::Specification.new do |gem|
10
10
  gem.name = 'declare'
11
11
  gem.version = Declare::VERSION.dup
12
12
 
13
- gem.required_ruby_version = '>= 1.9.3'
14
- gem.add_development_dependency 'yard', '>= 0.8.7.3', '< 0.9'
13
+ gem.required_ruby_version = '>= 2.2'
14
+
15
+ gem.add_development_dependency 'test-unit', '>= 3.2.6', '< 4'
16
+ gem.add_development_dependency 'yard', '>= 0.9.9', '< 2.0'
15
17
  gem.add_development_dependency 'rake', '>= 10', '< 20'
16
- gem.add_development_dependency 'bundler', '>= 1.3.5', '< 2'
17
18
 
18
19
  if RUBY_ENGINE == 'rbx'
19
- gem.add_dependency 'rubysl', '~> 2.0'
20
-
21
- gem.add_development_dependency 'test-unit', '>= 2.5.5', '< 2.6'
20
+ gem.add_dependency 'rubysl', '>= 2.2'
22
21
  end
23
22
 
24
23
  # common
@@ -29,5 +28,4 @@ Gem::Specification.new do |gem|
29
28
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
30
29
  gem.test_files = gem.files.grep(%r{^(test|spec|features|declare)/})
31
30
  gem.require_paths = ['lib']
32
-
33
- end
31
+ end
@@ -7,7 +7,7 @@ The(Array) {
7
7
  a Module
8
8
  kind Hash
9
9
  respond :to_str
10
-
10
+
11
11
  The(it.new) {
12
12
  a Hash
13
13
  }
@@ -22,7 +22,7 @@ The(1) {
22
22
  kind Float
23
23
  a Integer
24
24
  respond :to_str
25
-
25
+
26
26
  ok false
27
27
  ng true
28
28
 
@@ -33,11 +33,11 @@ The(1) {
33
33
  is 200
34
34
  end
35
35
  end
36
-
36
+
37
37
  RESCUE SyntaxError do
38
38
  raise
39
39
  end
40
-
40
+
41
41
  CATCH RuntimeError do
42
42
  raise Exception
43
43
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.require_paths = ['lib']
13
13
  gem.version = '0.0.1'
14
14
 
15
- gem.required_ruby_version = '>= 1.9.2'
15
+ gem.required_ruby_version = '>= 2.2'
16
16
 
17
17
  gem.add_development_dependency 'declare'
18
18
  gem.add_development_dependency 'rake'
@@ -22,7 +22,7 @@ The(1) {
22
22
  kind Float
23
23
  a Integer
24
24
  respond :to_str
25
-
25
+
26
26
  ok false
27
27
  ng true
28
28
 
@@ -33,11 +33,11 @@ The(1) {
33
33
  is 200
34
34
  end
35
35
  end
36
-
36
+
37
37
  RESCUE SyntaxError do
38
38
  raise
39
39
  end
40
-
40
+
41
41
  CATCH RuntimeError do
42
42
  raise Exception
43
43
  end
@@ -2,27 +2,24 @@
2
2
  $VERBOSE = true
3
3
 
4
4
  class Person
5
-
6
5
  attr_reader :name, :birth
7
-
6
+
8
7
  def initialize(name)
9
8
  @name = name
10
9
  @birth = Time.now
11
10
  end
12
-
13
11
  end
14
12
 
15
13
  require 'declare/autorun'
16
14
 
17
15
  The Person.new('John') do |john|
18
-
19
16
  can :name
20
17
  can :birth
21
18
  is_a Person
22
19
  kind_of Object
23
-
20
+
24
21
  NOT 'Taro'
25
-
22
+
26
23
  The john.name do |name|
27
24
  kind String
28
25
  is 'Taro'
@@ -33,5 +30,4 @@ The Person.new('John') do |john|
33
30
  The john.birth do
34
31
  kind_of Time
35
32
  end
36
-
37
33
  end
@@ -4,15 +4,12 @@ $VERBOSE = true
4
4
  require 'declare/autorun'
5
5
 
6
6
  The(Array) {
7
-
8
7
  a Class
9
8
  kind Module
10
9
  respond :new
11
-
12
10
  }
13
11
 
14
12
  The(1) {
15
-
16
13
  is 1.0
17
14
  is 1.to_r
18
15
  NOT 2
@@ -22,13 +19,12 @@ The(1) {
22
19
  kind Integer
23
20
  a Fixnum
24
21
  respond :upto
25
-
22
+
26
23
  RESCUE Exception do
27
24
  raise
28
25
  end
29
-
26
+
30
27
  CATCH NameError do
31
28
  to_str
32
29
  end
33
-
34
30
  }
@@ -2,9 +2,8 @@
2
2
  $VERBOSE = true
3
3
 
4
4
  class Person
5
-
6
5
  attr_reader :name, :birth
7
-
6
+
8
7
  def initialize(name)
9
8
  @name = name
10
9
  @birth = Time.now
@@ -15,14 +14,13 @@ end
15
14
  require_relative '../lib/declare/autorun'
16
15
 
17
16
  The Person.new('John') do |john|
18
-
19
17
  can :name
20
18
  can :birth
21
19
  is_a Person
22
20
  kind_of Object
23
-
21
+
24
22
  NOT 'Taro'
25
-
23
+
26
24
  The john.name do |name|
27
25
  kind String
28
26
  is 'Taro'
@@ -33,5 +31,4 @@ The Person.new('John') do |john|
33
31
  The john.birth do
34
32
  kind_of Time
35
33
  end
36
-
37
34
  end
@@ -4,15 +4,12 @@ $VERBOSE = true
4
4
  require_relative '../lib/declare/autorun'
5
5
 
6
6
  The(Array) {
7
-
8
7
  a Class
9
8
  kind Module
10
9
  respond :new
11
-
12
10
  }
13
11
 
14
12
  The(1) {
15
-
16
13
  is 1.0
17
14
  is 1.to_r
18
15
  NOT 2
@@ -22,13 +19,12 @@ The(1) {
22
19
  kind Integer
23
20
  a Fixnum
24
21
  respond :upto
25
-
22
+
26
23
  RESCUE Exception do
27
24
  raise
28
25
  end
29
-
26
+
30
27
  CATCH NameError do
31
28
  to_str
32
29
  end
33
-
34
30
  }
@@ -11,17 +11,13 @@ class Person
11
11
  end
12
12
 
13
13
  require_relative '../lib/declare'
14
-
14
+
15
15
  The Person do
16
-
17
16
  # This block is going to be evaluated in Declare::Scope
18
17
  # "it" is point to the "Person"
19
18
 
20
19
  The it.new('John') do
21
-
22
20
  # This block is going to be evaluated in Declare::Scope
23
21
  # "it" is point to the "John, who is instance of Person"
24
-
25
22
  end
26
-
27
23
  end
@@ -1,14 +1,12 @@
1
1
  # coding: us-ascii
2
2
 
3
3
  module Declare
4
-
5
4
  module Assertions
6
-
7
5
  # @param [Class] klass
8
6
  def INSTANCE_OF?(klass)
9
7
  @it.instance_of?(klass)
10
8
  end
11
-
9
+
12
10
  alias_method :A?, :INSTANCE_OF?
13
11
  alias_method :a?, :A?
14
12
 
@@ -24,17 +22,17 @@ module Declare
24
22
  ensure
25
23
  _declared!
26
24
  end
27
-
25
+
28
26
  alias_method :A, :INSTANCE_OF
29
27
  alias_method :a, :A
30
28
 
31
29
  def KIND_OF?(family)
32
30
  @it.kind_of? family
33
31
  end
34
-
32
+
35
33
  alias_method :KIND?, :KIND_OF?
36
34
  alias_method :kind?, :KIND?
37
-
35
+
38
36
  def KIND_OF(family)
39
37
  if KIND_OF? family
40
38
  pass
@@ -45,7 +43,7 @@ module Declare
45
43
  ensure
46
44
  _declared!
47
45
  end
48
-
46
+
49
47
  alias_method :kind_of, :KIND_OF
50
48
  alias_method :KIND, :KIND_OF
51
49
  alias_method :kind, :KIND
@@ -57,7 +55,7 @@ module Declare
57
55
  @it.eql?(sample) && sample.eql?(@it) && (@it.hash == sample.hash) &&
58
56
  ({@it => true}.has_key? sample)
59
57
  end
60
-
58
+
61
59
  def EQL(sample)
62
60
  if EQL? sample
63
61
  pass
@@ -69,14 +67,14 @@ module Declare
69
67
  end
70
68
 
71
69
  alias_method :eql, :EQL
72
-
70
+
73
71
  # true if under "=="
74
72
  def IS?(other, bidirectical=true)
75
73
  (@it == other) && (bidirectical ? (other == @it) : true)
76
74
  end
77
75
 
78
76
  alias_method :is?, :IS?
79
-
77
+
80
78
  def IS(other)
81
79
  if IS? other
82
80
  pass
@@ -93,9 +91,9 @@ module Declare
93
91
  def NOT?(other)
94
92
  (@it != other) && (other != @it) && !(IS?(other))
95
93
  end
96
-
94
+
97
95
  alias_method :not?, :NOT?
98
-
96
+
99
97
  def NOT(other)
100
98
  if NOT? other
101
99
  pass
@@ -106,7 +104,7 @@ module Declare
106
104
  ensure
107
105
  _declared!
108
106
  end
109
-
107
+
110
108
  # @param [#===] condition
111
109
  def MATCH?(condition)
112
110
  condition === @it
@@ -115,7 +113,7 @@ module Declare
115
113
  alias_method :match?, :MATCH?
116
114
  alias_method :SATISFY?, :MATCH?
117
115
  alias_method :satisfy?, :SATISFY?
118
-
116
+
119
117
  # @param [#===] condition
120
118
  def MATCH(condition)
121
119
  if ret = MATCH?(condition)
@@ -127,7 +125,7 @@ module Declare
127
125
  ensure
128
126
  _declared!
129
127
  end
130
-
128
+
131
129
  alias_method :match, :MATCH
132
130
  alias_method :SATISFY, :MATCH
133
131
  alias_method :satisfy, :SATISFY
@@ -136,7 +134,7 @@ module Declare
136
134
  def EQUAL?(other)
137
135
  @it.equal?(other) && other.equal?(@it) && (@it.__id__.equal? other.__id__)
138
136
  end
139
-
137
+
140
138
  def EQUAL(other)
141
139
  if EQUAL? other
142
140
  pass
@@ -147,11 +145,11 @@ module Declare
147
145
  ensure
148
146
  _declared!
149
147
  end
150
-
148
+
151
149
  alias_method :equal, :EQUAL
152
150
  alias_method :SAME, :EQUAL
153
151
  alias_method :same, :SAME
154
-
152
+
155
153
  # true if under "respond_to?"
156
154
  def RESPOND?(message)
157
155
  @it.respond_to? message
@@ -171,11 +169,11 @@ module Declare
171
169
  ensure
172
170
  _declared!
173
171
  end
174
-
172
+
175
173
  alias_method :respond, :RESPOND
176
174
  alias_method :CAN, :RESPOND
177
175
  alias_method :can, :CAN
178
-
176
+
179
177
  def TRUTHY?(object)
180
178
  !! object
181
179
  end
@@ -192,11 +190,11 @@ module Declare
192
190
  ensure
193
191
  _declared!
194
192
  end
195
-
193
+
196
194
  alias_method :truthy, :TRUTHY
197
195
  alias_method :OK, :TRUTHY
198
196
  alias_method :ok, :OK
199
-
197
+
200
198
  def FALTHY?(object)
201
199
  ! object
202
200
  end
@@ -213,11 +211,11 @@ module Declare
213
211
  ensure
214
212
  _declared!
215
213
  end
216
-
214
+
217
215
  alias_method :falthy, :FALTHY
218
216
  alias_method :NG, :FALTHY
219
217
  alias_method :ng, :NG
220
-
218
+
221
219
  # pass if occured the error is a own/subclassis instance
222
220
  # @param [Class] exception_klass
223
221
  def RESCUE(exception_klass, &block)
@@ -234,7 +232,7 @@ module Declare
234
232
  ensure
235
233
  _declared!
236
234
  end
237
-
235
+
238
236
  # pass if occured the error is just a own instance
239
237
  # @param [Class] exception_klass
240
238
  def CATCH(exception_klass, &block)
@@ -254,19 +252,17 @@ module Declare
254
252
  end
255
253
 
256
254
  private
257
-
255
+
258
256
  def _declared!
259
257
  ::Declare.declared!
260
258
  end
261
-
259
+
262
260
  def pass
263
261
  ::Declare.pass!
264
262
  end
265
-
263
+
266
264
  def failure(ecpected, actual, level=1)
267
265
  ::Declare.failure! "#{_declare_called_from level}\n Expected: #{ecpected}\n Actual : #{actual}\n\n"
268
266
  end
269
-
270
267
  end
271
-
272
268
  end
@@ -1,11 +1,8 @@
1
1
  # coding: us-ascii
2
2
 
3
3
  module Declare
4
-
5
4
  CallerEntry = Struct.new :file_name, :line_number, :method_name, :block_level do
6
-
7
5
  class << self
8
-
9
6
  # @param [String] caller_entry
10
7
  # @return [CallerEntry]
11
8
  # reference: http://doc.ruby-lang.org/ja/1.9.3/class/Kernel.html
@@ -20,19 +17,17 @@ module Declare
20
17
  else
21
18
  0
22
19
  end
23
-
20
+
24
21
  new file_name, line_number, method_name, block_level
25
22
  else
26
23
  raise TypeError, caller_entry
27
24
  end
28
25
  end
29
-
26
+
30
27
  end
31
-
28
+
32
29
  def to_s
33
30
  "#{file_name}:#{line_number}"
34
31
  end
35
-
36
32
  end
37
-
38
33
  end
@@ -1,7 +1,5 @@
1
1
  # coding: us-ascii
2
2
 
3
3
  class Object
4
-
5
4
  include Declare::ObjectExtension
6
-
7
5
  end
@@ -1,9 +1,7 @@
1
1
  # coding: us-ascii
2
2
 
3
3
  module Declare
4
-
5
4
  class UnhandledError < Exception; end
6
5
  class FrameworkError < StandardError; end
7
6
  class DupulicatedCategoryError < FrameworkError; end
8
-
9
7
  end
@@ -1,17 +1,15 @@
1
1
  # coding: us-ascii
2
2
 
3
3
  module Declare
4
-
5
4
  module ObjectExtension
6
-
7
5
  private
8
-
6
+
9
7
  # @return [Scope]
10
8
  def The(target, &block)
11
9
  Declare.scope! target, _declare_called_from
12
10
  Declare.new_scope(target, &block)
13
11
  end
14
-
12
+
15
13
  alias_method :_original_caller, :caller
16
14
 
17
15
  # @param [Integer] level
@@ -19,7 +17,5 @@ module Declare
19
17
  def _declare_called_from(level=0)
20
18
  CallerEntry.parse _original_caller[1 + level]
21
19
  end
22
-
23
20
  end
24
-
25
21
  end
@@ -3,19 +3,15 @@
3
3
  require_relative 'assertions'
4
4
 
5
5
  module Declare
6
-
7
6
  class Scope
8
-
9
7
  include Assertions
10
-
8
+
11
9
  attr_reader :it
12
-
10
+
13
11
  def initialize(target)
14
12
  @it = target
15
13
  end
16
-
17
- alias_method :_caller, :caller
18
14
 
15
+ alias_method :_caller, :caller
19
16
  end
20
-
21
17
  end
@@ -1,7 +1,6 @@
1
1
  # coding: us-ascii
2
2
 
3
3
  module Declare
4
-
5
4
  @auto_run = false
6
5
  @unexpected_failures = {}
7
6
  @failures = {}
@@ -10,30 +9,29 @@ module Declare
10
9
  @declare_counter = 0
11
10
 
12
11
  class << self
13
-
14
12
  attr_reader :failures
15
-
13
+
16
14
  ScopeSummary = Struct.new :target, :description, :caller_entry, :nesting_level
17
-
15
+
18
16
  def auto_run
19
17
  @auto_run = true
20
18
  at_exit do
21
19
  $! || report
22
20
  end
23
21
  end
24
-
22
+
25
23
  def auto_run?
26
24
  @auto_run
27
25
  end
28
-
26
+
29
27
  def unexpected_failure_in_the(scoped, exception, _caller)
30
28
  @unexpected_failures[scoped] = [exception, _caller]
31
29
  end
32
-
30
+
33
31
  def new_scope(target, &block)
34
32
  Scope.new(target).instance_exec(target, &block)
35
33
  end
36
-
34
+
37
35
  def declared!
38
36
  @declare_counter += 1
39
37
  end
@@ -45,7 +43,7 @@ module Declare
45
43
  def pass!
46
44
  @pass_counter += 1
47
45
  end
48
-
46
+
49
47
  def failure!(report)
50
48
  @failures[@scope_summaries.last] ||= []
51
49
  @failures[@scope_summaries.last] << report
@@ -56,11 +54,11 @@ module Declare
56
54
  report_detail
57
55
  puts '-' * 78
58
56
  end
59
-
57
+
60
58
  failure_count = @failures.values.flatten.length
61
59
  puts "#{@scope_summaries.length} scopes, #{@declare_counter} assertions, #{failure_count} failures"
62
60
  puts " Unexpected Failers: #{@unexpected_failures.inspect}" unless @unexpected_failures.empty?
63
-
61
+
64
62
  exit failure_count
65
63
  end
66
64
 
@@ -85,7 +83,5 @@ module Declare
85
83
  puts lines.map{|l|"* #{l}"}
86
84
  end
87
85
  end
88
-
89
86
  end
90
-
91
87
  end
@@ -1,7 +1,5 @@
1
1
  # coding: us-ascii
2
2
 
3
3
  module Declare
4
-
5
- VERSION = '0.0.6'.freeze
6
-
4
+ VERSION = '0.1.0'.freeze
7
5
  end
@@ -8,20 +8,19 @@ require_relative '../lib/declare'
8
8
 
9
9
  class Foo
10
10
  include Declare::Assertions
11
-
11
+
12
12
  attr_accessor :it
13
13
  end
14
14
 
15
15
  class Test_Declare_Assertions < Test::Unit::TestCase
16
-
17
16
  Scope = Foo.new
18
-
17
+
19
18
  def test_A?
20
19
  Scope.it = []
21
20
  assert_same true, Scope.A?(Array)
22
21
  assert_same false, Scope.A?(Object)
23
22
  end
24
-
23
+
25
24
  def test_KIND?
26
25
  Scope.it = []
27
26
  assert_same true, Scope.KIND?(Array)
@@ -29,35 +28,35 @@ class Test_Declare_Assertions < Test::Unit::TestCase
29
28
  assert_same true, Scope.KIND?(Object)
30
29
  assert_same false, Scope.KIND?(Hash)
31
30
  end
32
-
31
+
33
32
  def test_EQL?
34
33
  Scope.it = 1.0
35
34
  assert_same false, Scope.EQL?(1)
36
35
  assert_same true, Scope.EQL?(1.0)
37
36
  assert_same false, Scope.EQL?(1.1)
38
37
  end
39
-
38
+
40
39
  def test_IS?
41
40
  Scope.it = 1.0
42
41
  assert_same true, Scope.IS?(1)
43
42
  assert_same true, Scope.IS?(1.0)
44
43
  assert_same false, Scope.IS?(1.1)
45
44
  end
46
-
45
+
47
46
  def test_NOT?
48
47
  Scope.it = 1.0
49
48
  assert_same false, Scope.NOT?(1)
50
49
  assert_same false, Scope.NOT?(1.0)
51
50
  assert_same true, Scope.NOT?(1.1)
52
51
  end
53
-
52
+
54
53
  def test_MATCH?
55
54
  Scope.it = 'a'
56
55
  assert_same true, Scope.MATCH?(/a/)
57
56
  assert_same true, Scope.MATCH?('a')
58
57
  assert_same false, Scope.MATCH?(/b/)
59
58
  end
60
-
59
+
61
60
  def test_EQUAL?
62
61
  str = 'str'
63
62
  Scope.it = str
@@ -80,7 +79,7 @@ class Test_Declare_Assertions < Test::Unit::TestCase
80
79
  assert_same false, Scope.TRUTHY?(false)
81
80
  assert_same false, Scope.TRUTHY?(nil)
82
81
  end
83
-
82
+
84
83
  def test_FALTHY?
85
84
  Scope.it = nil
86
85
  assert_same false, Scope.FALTHY?(true)
@@ -89,5 +88,4 @@ class Test_Declare_Assertions < Test::Unit::TestCase
89
88
  assert_same true, Scope.FALTHY?(false)
90
89
  assert_same true, Scope.FALTHY?(nil)
91
90
  end
92
-
93
91
  end
@@ -4,9 +4,8 @@ require 'test/unit'
4
4
  class Test_Decalre_Behavior_Exception_Inner_NestedDeclare < Test::Unit::TestCase
5
5
  CODE = <<"EOD"
6
6
  class Person
7
-
8
7
  attr_reader :name, :birth
9
-
8
+
10
9
  def initialize(name)
11
10
  @name = name
12
11
  @birth = Time.now
@@ -4,9 +4,8 @@ require 'test/unit'
4
4
  class Test_Decalre_Behavior_Exception_Outer_Declare < Test::Unit::TestCase
5
5
  CODE = <<"EOD"
6
6
  class Person
7
-
8
7
  attr_reader :name, :birth
9
-
8
+
10
9
  def initialize(name)
11
10
  @name = name
12
11
  @birth = Time.now
@@ -4,9 +4,8 @@ require 'test/unit'
4
4
  class Test_Decalre_Behavior_Exception_Outer_NestedDeclare < Test::Unit::TestCase
5
5
  CODE = <<"EOD"
6
6
  class Person
7
-
8
7
  attr_reader :name, :birth
9
-
8
+
10
9
  def initialize(name)
11
10
  @name = name
12
11
  @birth = Time.now
@@ -4,28 +4,25 @@ require 'test/unit'
4
4
  class Test_Decalre_Behavior_Mixed < Test::Unit::TestCase
5
5
  CODE = <<"EOD"
6
6
  class Person
7
-
8
7
  attr_reader :name, :birth
9
-
8
+
10
9
  def initialize(name)
11
10
  @name = name
12
11
  @birth = Time.now
13
12
  end
14
-
15
13
  end
16
14
 
17
15
  app_dir = "#{File.expand_path('..', File.dirname(__FILE__))}"
18
16
  require app_dir + '/lib/declare/autorun'
19
17
 
20
18
  The Person.new('John') do |john|
21
-
22
19
  can :name
23
20
  can :birth
24
21
  is_a Person
25
22
  kind_of Object
26
-
23
+
27
24
  NOT 'Taro'
28
-
25
+
29
26
  The john.name do |name|
30
27
  kind String
31
28
  is 'Taro' # pass
@@ -37,7 +34,6 @@ The Person.new('John') do |john|
37
34
  The john.birth do
38
35
  kind_of Time
39
36
  end
40
-
41
37
  end
42
38
  EOD
43
39
 
metadata CHANGED
@@ -1,75 +1,75 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: declare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenichi Kamiya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-05 00:00:00.000000000 Z
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: yard
14
+ name: test-unit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.7.3
19
+ version: 3.2.6
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.9'
22
+ version: '4'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.8.7.3
29
+ version: 3.2.6
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.9'
32
+ version: '4'
33
33
  - !ruby/object:Gem::Dependency
34
- name: rake
34
+ name: yard
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '10'
39
+ version: 0.9.9
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '20'
42
+ version: '2.0'
43
43
  type: :development
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '10'
49
+ version: 0.9.9
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '20'
52
+ version: '2.0'
53
53
  - !ruby/object:Gem::Dependency
54
- name: bundler
54
+ name: rake
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 1.3.5
59
+ version: '10'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '2'
62
+ version: '20'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 1.3.5
69
+ version: '10'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '2'
72
+ version: '20'
73
73
  description: A unit testing framework.
74
74
  email:
75
75
  - kachick1+ruby@gmail.com
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.9.3
124
+ version: '2.2'
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - ">="
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  requirements: []
131
131
  rubyforge_project:
132
- rubygems_version: 2.2.0
132
+ rubygems_version: 2.7.0
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: A unit testing framework.
@@ -139,4 +139,3 @@ test_files:
139
139
  - test/test_behavior_exception_outer_declare.rb
140
140
  - test/test_behavior_exception_outer_neted_declare.rb
141
141
  - test/test_behavior_mixed.rb
142
- has_rdoc: