sasspectations 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,2 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
2
  load File.expand_path('../lib/tasks/sasspectations.rake', __FILE__)
3
+
4
+ namespace :sasspectations do
5
+ task :examples do
6
+ Rake::Task['sasspectations'].invoke('examples/spec/scss')
7
+ end
8
+ end
9
+
10
+ task :default => ['sasspectations:examples']
@@ -9,4 +9,6 @@ require "sasspectations/output_formatter"
9
9
 
10
10
  require "sasspectations/engine" if defined?(Rails)
11
11
 
12
- module Sasspectations; end
12
+ module Sasspectations
13
+ class SpecsNotFound < ArgumentError; end
14
+ end
@@ -8,7 +8,7 @@ module Sasspectations
8
8
  end
9
9
 
10
10
  def display
11
- puts "Running Scss specs:".colorize(:cyan)
11
+ puts "Running SCSS Specs:".colorize(:cyan)
12
12
  @spec_results.each do |result|
13
13
  print result.first
14
14
  end
@@ -21,7 +21,9 @@ module Sasspectations
21
21
  end
22
22
 
23
23
  def specs_path_glob
24
- Pathname.new(@root_path).join('spec', 'scss', '**', '*_spec.scss')
24
+ raise Sasspectations::SpecsNotFound unless File.exists?(@root_path)
25
+
26
+ Pathname.new(@root_path).join('**', '*_spec.scss')
25
27
  end
26
28
 
27
29
  end
@@ -1,3 +1,3 @@
1
1
  module Sasspectations
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -2,20 +2,19 @@ $:.unshift(File.expand_path('../..', __FILE__)) unless $:.include? File.expand_p
2
2
 
3
3
  require 'sasspectations'
4
4
 
5
- namespace :sasspectations do
6
- desc 'Run SCSS specs'
7
- task :run, :path do |t, args|
8
- path = Pathname.new(Dir.pwd).join(args[:path] || '.').to_s
9
- runner = Sasspectations::Runner.new(path)
5
+ desc 'Run SCSS specs'
6
+ task :sasspectations, :path do |t, args|
7
+ path = Pathname.new(Dir.pwd).join(args[:path] || 'spec/scss').to_s
10
8
 
11
- # Parsing *then* displaying the results won't provide continuous feedback
12
- # for large test suites. This parsing operation will be fairly quick no
13
- # matter what, so it doesn't seem to be a problem, but may want to
14
- # reconsider this later
15
- #
9
+ runner = Sasspectations::Runner.new(path)
10
+ begin
16
11
  parser = Sasspectations::ResultParser.new(runner.render)
17
- output_formatter = Sasspectations::OutputFormatter.new(parser.tap(&:parse))
18
- output_formatter.display
19
- exit 1 if parser.failed?
12
+ rescue Sasspectations::SpecsNotFound
13
+ puts 'Path provided is not valid, please check your path and try again.'
14
+ exit 1
20
15
  end
16
+
17
+ output_formatter = Sasspectations::OutputFormatter.new(parser.tap(&:parse))
18
+ output_formatter.display
19
+ exit 1 if parser.failed?
21
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sasspectations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-11 00:00:00.000000000 Z
13
+ date: 2013-02-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sass
17
- requirement: &70193548430800 !ruby/object:Gem::Requirement
17
+ requirement: &70145301411620 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.2.5
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70193548430800
25
+ version_requirements: *70145301411620
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: colorize
28
- requirement: &70193548430240 !ruby/object:Gem::Requirement
28
+ requirement: &70145301411060 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 0.5.8
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70193548430240
36
+ version_requirements: *70145301411060
37
37
  description: Spec runner for Sass
38
38
  email:
39
39
  - ajaswa@gmail.com