spicycode-micronaut 0.2.0.0 → 0.2.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rubygems/specification'
4
4
  require 'lib/micronaut/rake_task'
5
5
 
6
6
  GEM = "micronaut"
7
- GEM_VERSION = "0.2.0.0"
7
+ GEM_VERSION = "0.2.1.0"
8
8
  AUTHOR = "Chad Humphries"
9
9
  EMAIL = "chad@spicycode.com"
10
10
  HOMEPAGE = "http://github.com/spicycode/micronaut"
@@ -33,8 +33,12 @@ def not_in_editor?
33
33
  ['TM_MODE', 'EMACS', 'VIM'].all? { |k| !ENV.has_key?(k) }
34
34
  end
35
35
 
36
+ def runcoderun?
37
+ ENV["RUN_CODE_RUN"]
38
+ end
39
+
36
40
  Micronaut.configure do |c|
37
- #c.formatter = :documentation
41
+ c.formatter = :documentation if runcoderun?
38
42
  c.mock_with :mocha
39
43
  c.color_enabled = not_in_editor?
40
44
  c.filter_run :focused => true
@@ -105,5 +105,21 @@ describe Micronaut::Configuration do
105
105
  end
106
106
 
107
107
  end
108
+
109
+ describe '#formatter' do
110
+
111
+ it "sets formatter_to_use based on name" do
112
+ config = Micronaut::Configuration.new
113
+ config.formatter = :documentation
114
+ config.instance_eval { @formatter_to_use.should == Micronaut::Formatters::DocumentationFormatter }
115
+ config.formatter = 'documentation'
116
+ config.instance_eval { @formatter_to_use.should == Micronaut::Formatters::DocumentationFormatter }
117
+ end
118
+
119
+ it "raises ArgumentError if formatter is unknown" do
120
+ config = Micronaut::Configuration.new
121
+ lambda { config.formatter = :progresss }.should raise_error(ArgumentError)
122
+ end
123
+ end
108
124
 
109
125
  end
@@ -88,6 +88,7 @@ module Micronaut
88
88
  @formatter_to_use = case formatter_to_use.to_s
89
89
  when 'documentation' then Micronaut::Formatters::DocumentationFormatter
90
90
  when 'progress' then Micronaut::Formatters::ProgressFormatter
91
+ else raise(ArgumentError, "Formatter '#{formatter_to_use}' unknown - maybe you meant 'documentation' or 'progress'?.")
91
92
  end
92
93
  end
93
94
 
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.2.0.0
4
+ version: 0.2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Humphries