spicycode-micronaut 0.2.1.6 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +15 -0
- data/Rakefile +14 -43
- data/VERSION.yml +4 -0
- data/examples/example_helper.rb +0 -1
- data/examples/lib/micronaut/behaviour_example.rb +13 -13
- data/examples/lib/micronaut/example_example.rb +0 -1
- data/lib/micronaut/behaviour.rb +20 -22
- metadata +12 -11
data/History.txt
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
0.0.8
|
2
|
+
=======================
|
3
|
+
- It turns out I'm horrible at updating history files
|
4
|
+
- Added MockWith::AbsolutelyNothing as the default
|
5
|
+
- Added the ability to setup before, after, include, and extend blocks using a extensible API
|
6
|
+
|
7
|
+
0.0.6
|
8
|
+
=======================
|
9
|
+
- MockWith::Mocha autoloads now
|
10
|
+
- Beginnings of the configure block in example helper
|
11
|
+
- Ability to search behaviour groups is in
|
12
|
+
|
13
|
+
0.0.5
|
14
|
+
=======================
|
15
|
+
- Describes are working at any level, befores/afters correctly cascade
|
data/Rakefile
CHANGED
@@ -1,48 +1,19 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake/gempackagetask'
|
3
|
-
require 'rubygems/specification'
|
4
1
|
require 'lib/micronaut/rake_task'
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
s.
|
20
|
-
s.description = s.summary
|
21
|
-
s.author = AUTHOR
|
22
|
-
s.email = EMAIL
|
23
|
-
s.homepage = HOMEPAGE
|
24
|
-
s.bindir = 'bin'
|
25
|
-
s.default_executable = 'micronaut'
|
26
|
-
s.executables = ["micronaut"]
|
27
|
-
s.require_path = 'lib'
|
28
|
-
s.autorequire = GEM
|
29
|
-
s.files = %w(LICENSE README.markdown RSPEC-LICENSE Rakefile) + Dir.glob("{lib,examples}/**/*")
|
30
|
-
end
|
31
|
-
|
32
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
33
|
-
pkg.gem_spec = spec
|
34
|
-
end
|
35
|
-
|
36
|
-
desc "install the gem locally"
|
37
|
-
task :install => [:package] do
|
38
|
-
sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
|
39
|
-
end
|
40
|
-
|
41
|
-
desc "create a gemspec file"
|
42
|
-
task :make_gemspec do
|
43
|
-
File.open("#{GEM}.gemspec", "w") do |file|
|
44
|
-
file.puts spec.to_ruby
|
45
|
-
end
|
3
|
+
begin
|
4
|
+
require 'jeweler'
|
5
|
+
Jeweler::Tasks.new do |s|
|
6
|
+
s.name = "micronaut"
|
7
|
+
s.executables = "micronaut"
|
8
|
+
s.summary = "An excellent replacement for the wheel..."
|
9
|
+
s.email = "chad@spicycode.com"
|
10
|
+
s.homepage = "http://github.com/spicycode/micronaut"
|
11
|
+
s.description = "An excellent replacement for the wheel..."
|
12
|
+
s.authors = ["Chad Humphries"]
|
13
|
+
s.files = FileList["[A-Z]*", "{bin,lib,examples}/**/*"]
|
14
|
+
end
|
15
|
+
rescue LoadError
|
16
|
+
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
46
17
|
end
|
47
18
|
|
48
19
|
desc "List files that don't have examples"
|
data/VERSION.yml
ADDED
data/examples/example_helper.rb
CHANGED
@@ -100,9 +100,9 @@ describe Micronaut::Behaviour do
|
|
100
100
|
group.before(:each) { 'A' }
|
101
101
|
group.before(:each) { 33.5 }
|
102
102
|
|
103
|
-
group.before_eachs[0].
|
104
|
-
group.before_eachs[1].
|
105
|
-
group.before_eachs[2].
|
103
|
+
group.before_eachs[0].call.should == 15
|
104
|
+
group.before_eachs[1].call.should == 'A'
|
105
|
+
group.before_eachs[2].call.should == 33.5
|
106
106
|
end
|
107
107
|
|
108
108
|
it "should expose the before all blocks at before_alls" do
|
@@ -117,9 +117,9 @@ describe Micronaut::Behaviour do
|
|
117
117
|
group.before(:all) { 'A' }
|
118
118
|
group.before(:all) { 33.5 }
|
119
119
|
|
120
|
-
group.before_alls[0].
|
121
|
-
group.before_alls[1].
|
122
|
-
group.before_alls[2].
|
120
|
+
group.before_alls[0].call.should == 15
|
121
|
+
group.before_alls[1].call.should == 'A'
|
122
|
+
group.before_alls[2].call.should == 33.5
|
123
123
|
end
|
124
124
|
|
125
125
|
it "should expose the after each blocks at after_eachs" do
|
@@ -134,9 +134,9 @@ describe Micronaut::Behaviour do
|
|
134
134
|
group.after(:each) { 'A' }
|
135
135
|
group.after(:each) { 33.5 }
|
136
136
|
|
137
|
-
group.after_eachs[0].
|
138
|
-
group.after_eachs[1].
|
139
|
-
group.after_eachs[2].
|
137
|
+
group.after_eachs[0].call.should == 15
|
138
|
+
group.after_eachs[1].call.should == 'A'
|
139
|
+
group.after_eachs[2].call.should == 33.5
|
140
140
|
end
|
141
141
|
|
142
142
|
it "should expose the after all blocks at after_alls" do
|
@@ -151,9 +151,9 @@ describe Micronaut::Behaviour do
|
|
151
151
|
group.after(:all) { 'A' }
|
152
152
|
group.after(:all) { 33.5 }
|
153
153
|
|
154
|
-
group.after_alls[0].
|
155
|
-
group.after_alls[1].
|
156
|
-
group.after_alls[2].
|
154
|
+
group.after_alls[0].call.should == 15
|
155
|
+
group.after_alls[1].call.should == 'A'
|
156
|
+
group.after_alls[2].call.should == 33.5
|
157
157
|
end
|
158
158
|
|
159
159
|
end
|
@@ -246,4 +246,4 @@ describe Micronaut::Behaviour do
|
|
246
246
|
|
247
247
|
end
|
248
248
|
|
249
|
-
end
|
249
|
+
end
|
@@ -50,7 +50,6 @@ describe Micronaut::Example, :parent_metadata => 'sample' do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should be able to access the behaviours top level metadata as if it were its own" do
|
53
|
-
running_example.metadata.each { |k,v| puts "#{k} => #{v.inspect}\n\n" }
|
54
53
|
running_example.behaviour.metadata.should include(:parent_metadata => 'sample')
|
55
54
|
running_example.metadata.should include(:parent_metadata => 'sample')
|
56
55
|
end
|
data/lib/micronaut/behaviour.rb
CHANGED
@@ -27,8 +27,8 @@ module Micronaut
|
|
27
27
|
befores[:all]
|
28
28
|
end
|
29
29
|
|
30
|
-
def self.before(type=:each,
|
31
|
-
befores[type] <<
|
30
|
+
def self.before(type=:each, &block)
|
31
|
+
befores[type] << block
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.afters
|
@@ -43,8 +43,8 @@ module Micronaut
|
|
43
43
|
afters[:all]
|
44
44
|
end
|
45
45
|
|
46
|
-
def self.after(type=:each,
|
47
|
-
afters[type] <<
|
46
|
+
def self.after(type=:each, &block)
|
47
|
+
afters[type] << block
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.example(desc=nil, options={}, &block)
|
@@ -156,38 +156,36 @@ module Micronaut
|
|
156
156
|
@_after_ancestors ||= ancestors(true)
|
157
157
|
end
|
158
158
|
|
159
|
-
def self.eval_before_alls(
|
159
|
+
def self.eval_before_alls(running_behaviour)
|
160
|
+
Micronaut.configuration.find_before_or_after(:before, :all, self).each { |blk| running_behaviour.instance_eval(&blk) }
|
161
|
+
|
160
162
|
before_ancestors.each do |ancestor|
|
161
|
-
ancestor.before_alls.each { |
|
163
|
+
ancestor.before_alls.each { |blk| running_behaviour.instance_eval(&blk) }
|
162
164
|
end
|
163
|
-
|
164
|
-
Micronaut.configuration.find_before_or_after(:before, :all, self).each { |blk| example.instance_eval(&blk) }
|
165
165
|
end
|
166
166
|
|
167
|
-
def self.eval_before_eachs(
|
167
|
+
def self.eval_before_eachs(running_behaviour)
|
168
|
+
Micronaut.configuration.find_before_or_after(:before, :each, self).each { |blk| running_behaviour.instance_eval(&blk) }
|
169
|
+
|
168
170
|
before_ancestors.each do |ancestor|
|
169
|
-
ancestor.before_eachs.each { |
|
171
|
+
ancestor.before_eachs.each { |blk| running_behaviour.instance_eval(&blk) }
|
170
172
|
end
|
171
|
-
|
172
|
-
Micronaut.configuration.find_before_or_after(:before, :each, self).each { |blk| example.instance_eval(&blk) }
|
173
173
|
end
|
174
174
|
|
175
|
-
def self.eval_after_alls(
|
176
|
-
Micronaut.configuration.find_before_or_after(:after, :all, self).each { |blk| example.instance_eval(&blk) }
|
177
|
-
|
175
|
+
def self.eval_after_alls(running_behaviour)
|
178
176
|
after_ancestors.each do |ancestor|
|
179
|
-
ancestor.after_alls.each { |
|
177
|
+
ancestor.after_alls.each { |blk| running_behaviour.instance_eval(&blk) }
|
180
178
|
end
|
179
|
+
|
180
|
+
Micronaut.configuration.find_before_or_after(:after, :all, self).each { |blk| running_behaviour.instance_eval(&blk) }
|
181
181
|
end
|
182
182
|
|
183
|
-
def self.eval_after_eachs(
|
184
|
-
Micronaut.configuration.find_before_or_after(:after, :each, self).each { |blk| example.instance_eval(&blk) }
|
185
|
-
|
183
|
+
def self.eval_after_eachs(running_behaviour)
|
186
184
|
after_ancestors.each do |ancestor|
|
187
|
-
ancestor.after_eachs.each { |
|
185
|
+
ancestor.after_eachs.each { |blk| running_behaviour.instance_eval(&blk) }
|
188
186
|
end
|
189
|
-
|
190
|
-
|
187
|
+
|
188
|
+
Micronaut.configuration.find_before_or_after(:after, :each, self).each { |blk| running_behaviour.instance_eval(&blk) }
|
191
189
|
end
|
192
190
|
|
193
191
|
def self.run(reporter)
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spicycode-micronaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Humphries
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-02-09 00:00:00 -08:00
|
13
13
|
default_executable: micronaut
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -19,15 +19,16 @@ executables:
|
|
19
19
|
- micronaut
|
20
20
|
extensions: []
|
21
21
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
24
|
-
- LICENSE
|
25
|
-
- RSPEC-LICENSE
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
26
24
|
files:
|
25
|
+
- History.txt
|
27
26
|
- LICENSE
|
27
|
+
- Rakefile
|
28
28
|
- README.markdown
|
29
29
|
- RSPEC-LICENSE
|
30
|
-
-
|
30
|
+
- VERSION.yml
|
31
|
+
- bin/micronaut
|
31
32
|
- lib/micronaut
|
32
33
|
- lib/micronaut/behaviour.rb
|
33
34
|
- lib/micronaut/configuration.rb
|
@@ -111,12 +112,12 @@ files:
|
|
111
112
|
- examples/lib/micronaut_example.rb
|
112
113
|
- examples/resources
|
113
114
|
- examples/resources/example_classes.rb
|
114
|
-
- bin/micronaut
|
115
115
|
has_rdoc: true
|
116
116
|
homepage: http://github.com/spicycode/micronaut
|
117
117
|
post_install_message:
|
118
|
-
rdoc_options:
|
119
|
-
|
118
|
+
rdoc_options:
|
119
|
+
- --inline-source
|
120
|
+
- --charset=UTF-8
|
120
121
|
require_paths:
|
121
122
|
- lib
|
122
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|