spicycode-micronaut 0.1.8.0 → 0.1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +47 -0
- data/Rakefile +6 -8
- data/examples/lib/micronaut/configuration_example.rb +2 -3
- data/examples/lib/micronaut/formatters/base_formatter_example.rb +0 -12
- data/lib/micronaut/configuration.rb +0 -2
- data/lib/micronaut/formatters/base_formatter.rb +2 -2
- data/lib/micronaut/world.rb +0 -2
- metadata +4 -4
- data/README +0 -16
data/README.markdown
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Micronaut
|
2
|
+
|
3
|
+
* [Codes - http://github.com/spicycode/micronaut](http://github.com/spicycode/micronaut)
|
4
|
+
* [Specs - http://runcoderun.com/spicycode/micronaut](http://runcoderun.com/spicycode/micronaut)
|
5
|
+
* [Rails - http://github.com/spicycode/micronaut-rails](http://github.com/spicycode/micronaut-rails)
|
6
|
+
|
7
|
+
## DESCRIPTION:
|
8
|
+
|
9
|
+
Micronaut is a light-weight BDD test framework.
|
10
|
+
|
11
|
+
## FEATURES:
|
12
|
+
|
13
|
+
* API compatible with RSpec (of course)
|
14
|
+
|
15
|
+
* Slim and light, designed to be readable, compact, and fast. Just over ~1600 LOC in /lib at last count.
|
16
|
+
|
17
|
+
* Each example has its own metadata, and you can add filters or modules to run/disable/enhance examples based on that metadata at run time
|
18
|
+
* A Real-world example of the power the metadata gives you:
|
19
|
+
|
20
|
+
* "Focused specs". Never drop out of Autotest again - just focus on the spec(s) and ignore the rest:
|
21
|
+
|
22
|
+
Micronaut.configure do |c| # in your spec_helper
|
23
|
+
c.filter_run :focused => true
|
24
|
+
end
|
25
|
+
|
26
|
+
describe Foo do
|
27
|
+
it "autotest will only run this spec, even if your whole suite loads", :focused => true do
|
28
|
+
end
|
29
|
+
|
30
|
+
# equivalent to:
|
31
|
+
focused "is an example_alias to pass in the :focused => true metadata" do
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
* Add your own metadata options and customize Micronaut to your hearts content (pending specs are implemented as ':pending => true' metadata, for example)
|
36
|
+
|
37
|
+
* Designed to be formatter compatible with RSpec (though this needs some real-world testing)
|
38
|
+
|
39
|
+
## REQUIREMENTS:
|
40
|
+
|
41
|
+
+ Ruby 1.8.5+
|
42
|
+
|
43
|
+
## CREDITS:
|
44
|
+
|
45
|
+
* Mini/Unit for the great ideas and runner
|
46
|
+
* RSpec for the great ideas, matchers, expectations and formatter ideas
|
47
|
+
* Matchers are licensed under the MIT license, per RSpec (see RSPEC-LICENSE)
|
data/Rakefile
CHANGED
@@ -3,10 +3,10 @@ require 'rake/gempackagetask'
|
|
3
3
|
require 'rubygems/specification'
|
4
4
|
|
5
5
|
GEM = "micronaut"
|
6
|
-
GEM_VERSION = "0.1.8.
|
6
|
+
GEM_VERSION = "0.1.8.1"
|
7
7
|
AUTHOR = "Chad Humphries"
|
8
8
|
EMAIL = "chad@spicycode.com"
|
9
|
-
HOMEPAGE = "http://
|
9
|
+
HOMEPAGE = "http://github.com/spicycode/micronaut"
|
10
10
|
SUMMARY = "An excellent replacement for the wheel..."
|
11
11
|
|
12
12
|
spec = Gem::Specification.new do |s|
|
@@ -14,7 +14,7 @@ spec = Gem::Specification.new do |s|
|
|
14
14
|
s.version = GEM_VERSION
|
15
15
|
s.platform = Gem::Platform::RUBY
|
16
16
|
s.has_rdoc = true
|
17
|
-
s.extra_rdoc_files = ["README", "LICENSE", "RSPEC-LICENSE"]
|
17
|
+
s.extra_rdoc_files = ["README.markdown", "LICENSE", "RSPEC-LICENSE"]
|
18
18
|
s.summary = SUMMARY
|
19
19
|
s.description = s.summary
|
20
20
|
s.author = AUTHOR
|
@@ -25,7 +25,7 @@ spec = Gem::Specification.new do |s|
|
|
25
25
|
s.executables = ["micronaut"]
|
26
26
|
s.require_path = 'lib'
|
27
27
|
s.autorequire = GEM
|
28
|
-
s.files = %w(LICENSE README RSPEC-LICENSE Rakefile) + Dir.glob("{lib,examples}/**/*")
|
28
|
+
s.files = %w(LICENSE README.markdown RSPEC-LICENSE Rakefile) + Dir.glob("{lib,examples}/**/*")
|
29
29
|
end
|
30
30
|
|
31
31
|
Rake::GemPackageTask.new(spec) do |pkg|
|
@@ -55,10 +55,8 @@ task :untested do
|
|
55
55
|
code = Dir["lib/**/*.rb"].map { |g| Dir.glob(g) }.flatten
|
56
56
|
examples = Dir["examples/**/*_example.rb"].map { |g| Dir.glob(g) }.flatten
|
57
57
|
examples.map! { |f| f =~ /examples\/(.*)_example/; "#{$1}.rb" }
|
58
|
-
|
59
|
-
|
60
|
-
puts "The following files seem to be missing their examples:"
|
61
|
-
missing_examples.each do |missing|
|
58
|
+
puts "\nThe following files seem to be missing their examples:"
|
59
|
+
(code - examples).each do |missing|
|
62
60
|
puts " #{missing}"
|
63
61
|
end
|
64
62
|
end
|
@@ -122,16 +122,4 @@ describe Micronaut::Formatters::BaseFormatter do
|
|
122
122
|
|
123
123
|
end
|
124
124
|
|
125
|
-
describe '#trace' do
|
126
|
-
|
127
|
-
it "outputs trace message if behaviour metadata has :trace => true" do
|
128
|
-
Micronaut.configuration.output.expects(:puts).with(includes("Starting example: example"))
|
129
|
-
behaviour = Micronaut::Behaviour.describe("foo", :trace => true) {}
|
130
|
-
@formatter.behaviour = behaviour
|
131
|
-
@formatter.example_started("example")
|
132
|
-
end
|
133
|
-
|
134
|
-
end
|
135
|
-
|
136
|
-
|
137
125
|
end
|
@@ -116,8 +116,6 @@ module Micronaut
|
|
116
116
|
@trace == true
|
117
117
|
end
|
118
118
|
|
119
|
-
# RJS I think we should rename include/extend so they don't conflict or confuse with the ruby builtin
|
120
|
-
# maybe register_include, setup_include, add_include, or just _include ?
|
121
119
|
def include(mod, options={})
|
122
120
|
include_or_extend_modules << [:include, mod, options]
|
123
121
|
end
|
@@ -67,12 +67,10 @@ module Micronaut
|
|
67
67
|
|
68
68
|
# This method is invoked when an +example+ starts.
|
69
69
|
def example_started(example)
|
70
|
-
trace { "Starting example: #{example}" }
|
71
70
|
end
|
72
71
|
|
73
72
|
# This method is invoked when an +example+ passes.
|
74
73
|
def example_passed(example)
|
75
|
-
trace { "Example passed: #{example}" }
|
76
74
|
end
|
77
75
|
|
78
76
|
# This method is invoked when an +example+ fails, i.e. an exception occurred
|
@@ -119,6 +117,8 @@ module Micronaut
|
|
119
117
|
return backtrace if example.metadata[:full_backtrace] == true
|
120
118
|
|
121
119
|
cleansed = backtrace.select { |line| backtrace_line(line) }
|
120
|
+
# Kick the describe stack info off the list, just keep the line the problem happened on from that file
|
121
|
+
cleansed = cleansed.detect { |line| line.split(':').first == example.metadata[:caller].split(':').first } if cleansed.size > 1
|
122
122
|
cleansed.empty? ? backtrace : cleansed
|
123
123
|
end
|
124
124
|
|
data/lib/micronaut/world.rb
CHANGED
@@ -17,8 +17,6 @@ module Micronaut
|
|
17
17
|
|
18
18
|
if filter
|
19
19
|
@behaviours_to_run = filter_behaviours
|
20
|
-
# RJS the line below is very confusing and looks like a dupe of the line below it -- is it dead code or does it serve a purpose?
|
21
|
-
behaviours_to_run.size == 0 && Micronaut.configuration.run_all_when_everything_filtered?
|
22
20
|
if @behaviours_to_run.size == 0 && Micronaut.configuration.run_all_when_everything_filtered?
|
23
21
|
puts "No behaviours were matched by #{filter.inspect}, running all"
|
24
22
|
# reset the behaviour list to all behaviours, and add back all examples
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spicycode-micronaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Humphries
|
@@ -20,12 +20,12 @@ executables:
|
|
20
20
|
extensions: []
|
21
21
|
|
22
22
|
extra_rdoc_files:
|
23
|
-
- README
|
23
|
+
- README.markdown
|
24
24
|
- LICENSE
|
25
25
|
- RSPEC-LICENSE
|
26
26
|
files:
|
27
27
|
- LICENSE
|
28
|
-
- README
|
28
|
+
- README.markdown
|
29
29
|
- RSPEC-LICENSE
|
30
30
|
- Rakefile
|
31
31
|
- lib/autotest
|
@@ -117,7 +117,7 @@ files:
|
|
117
117
|
- examples/resources/example_classes.rb
|
118
118
|
- bin/micronaut
|
119
119
|
has_rdoc: true
|
120
|
-
homepage: http://
|
120
|
+
homepage: http://github.com/spicycode/micronaut
|
121
121
|
post_install_message:
|
122
122
|
rdoc_options: []
|
123
123
|
|
data/README
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
= Micronaut
|
2
|
-
|
3
|
-
* http://github.com/spicycode/micronaut
|
4
|
-
|
5
|
-
== DESCRIPTION:
|
6
|
-
|
7
|
-
Micronaut is a light-weight BDD test framework.
|
8
|
-
|
9
|
-
== REQUIREMENTS:
|
10
|
-
|
11
|
-
+ Ruby 1.8
|
12
|
-
|
13
|
-
== CREDITS:
|
14
|
-
|
15
|
-
* Mini/Unit for the great ideas and runner
|
16
|
-
* RSpec for the great ideas, matchers, expectations and formatter ideas
|