snapdragon 0.1.11 → 0.1.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9390e3dda99e7b5b4504f7b2ab6b8378a6af47c
4
- data.tar.gz: 6d0791fc137d5b7abe928089059d821149855ef4
3
+ metadata.gz: b8aad99b89a86f7409439f78820527090c48188f
4
+ data.tar.gz: 2707cb606f2f5ae2f3e72783b27e18efa25e4d5b
5
5
  SHA512:
6
- metadata.gz: 722a22b9ce7b80b9681d1b373d2f562f007076d436120fb930a909a658cf8fecbda903799aa0363e2e0579f9fec329a4cc4373746cdb5589d24dbeed5a3af608
7
- data.tar.gz: 35900ed38fc0923362b9b3fff2aab8fbb02149b8bf77ae394ffc5f15574dd8bbf12782c138de308c3de3e040d2dc3e2ce4f0d2b4ddbe2547111764f1f23fb7b4
6
+ metadata.gz: 9eef67ae9b2468cbf3bedef07fc8219a0a14657a2d2ac4717bc19adfafa382f187621b4f5794775b276c40d89fc7601ef1ecbcf41d0daee6a383e8f8581a0a52
7
+ data.tar.gz: 719add788cd12f7729f631f39d597bf0e47d68186b6cd03cd9fee92893d83b937a960d2be03ad73d2a6f5ecf25c78073f9d75284c8a69c955f8bb09415b9a837
@@ -6,6 +6,11 @@ versions as well as provide a rough history.
6
6
 
7
7
  #### Next Release
8
8
 
9
+ #### v0.1.12
10
+
11
+ * add the --color, --no-color, --colour, --no-colour, and -c option to
12
+ enable/disable color output
13
+
9
14
  #### v0.1.11
10
15
 
11
16
  * fixed issue where junit formatter was outputing multiple xml docs.
@@ -7,6 +7,7 @@ module Snapdragon
7
7
  def self.parse(args)
8
8
  options = OpenStruct.new
9
9
  options.format = "console"
10
+ options.color = true
10
11
 
11
12
  opts = OptionParser.new do |opts|
12
13
  opts.banner = "Usage: snapdragon [options] [files or directories]"
@@ -19,6 +20,9 @@ module Snapdragon
19
20
  opts.on('-f', '--format [FORMAT]', "set output format") do |format|
20
21
  options.format = format
21
22
  end
23
+ opts.on('-c', '--[no-]color', '--[no-]colour', 'Enable color in the output.') do |o|
24
+ options.color = o
25
+ end
22
26
  if args.empty?
23
27
  puts opts; exit
24
28
  end
@@ -1,6 +1,6 @@
1
1
  jasmine.SnapdragonConsoleReporter = function(options) {
2
2
  var print = function(msg) { console.log(msg); },
3
- showColors = options.showColors || true,
3
+ showColors = options.showColors,
4
4
  onComplete = options.onComplete || function() {},
5
5
  specCount,
6
6
  failureCount,
@@ -11,6 +11,10 @@ module Snapdragon
11
11
  @options.format
12
12
  end
13
13
 
14
+ def use_color?
15
+ @options.color
16
+ end
17
+
14
18
  def spec_files
15
19
  spec_file_objs = []
16
20
 
@@ -1,3 +1,3 @@
1
1
  module Snapdragon
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
@@ -34,7 +34,12 @@
34
34
  var snapdragonJUnitReporter = new jasmine.SnapdragonJUnitReporter();
35
35
  jasmineEnv.addReporter(snapdragonJUnitReporter);
36
36
  <% else %>
37
- var snapdragonConsoleReporter = new jasmine.SnapdragonConsoleReporter({});
37
+ var reporterOptions = {};
38
+ <% if @suite.use_color? %>
39
+ reporterOptions.showColors = true;
40
+ <% end %>
41
+
42
+ var snapdragonConsoleReporter = new jasmine.SnapdragonConsoleReporter(reporterOptions);
38
43
  jasmineEnv.addReporter(snapdragonConsoleReporter);
39
44
  <% end %>
40
45
 
@@ -46,5 +46,17 @@ describe Snapdragon::CommandLineParser do
46
46
  subject.parse(["spec/hello_spec.rb"]).format.should eq "console"
47
47
  end
48
48
  end
49
+
50
+ context "when color option is not provided" do
51
+ it "defaults to true" do
52
+ subject.parse(["spec/hello_spec.rb"]).color.should eq true
53
+ end
54
+ end
55
+
56
+ context "when no-color option is provided" do
57
+ it "sets the color option" do
58
+ subject.parse(["--no-color", "spec/hello_spec.rb"]).color.should eq false
59
+ end
60
+ end
49
61
  end
50
62
  end
@@ -32,6 +32,15 @@ describe Snapdragon::Suite do
32
32
  end
33
33
  end
34
34
 
35
+ describe "#use_color?" do
36
+ it "returns the configured color setting" do
37
+ color = stub
38
+ options = stub(color: color)
39
+ suite = Snapdragon::Suite.new(options, stub)
40
+ suite.use_color?.should eq color
41
+ end
42
+ end
43
+
35
44
  describe "#spec_files" do
36
45
  it "creates a path object to represent the path" do
37
46
  options = stub
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapdragon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-18 00:00:00.000000000 Z
11
+ date: 2013-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara