sasspectations 0.0.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.
Files changed (51) hide show
  1. data/.gitignore +17 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +11 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +44 -0
  6. data/Rakefile +2 -0
  7. data/examples/functions.scss +23 -0
  8. data/examples/maths.scss +8 -0
  9. data/examples/spec/scss/functions_spec.scss +44 -0
  10. data/examples/spec/scss/math_spec.scss +30 -0
  11. data/lib/sasspectations/engine.rb +7 -0
  12. data/lib/sasspectations/output_formatter.rb +27 -0
  13. data/lib/sasspectations/result_parser.rb +30 -0
  14. data/lib/sasspectations/runner.rb +29 -0
  15. data/lib/sasspectations/version.rb +3 -0
  16. data/lib/sasspectations.rb +12 -0
  17. data/lib/sasspectations_matchers.rb +108 -0
  18. data/lib/tasks/sasspectations.rake +21 -0
  19. data/sasspectations.gemspec +22 -0
  20. data/spec/dummy/.gitignore +15 -0
  21. data/spec/dummy/Rakefile +7 -0
  22. data/spec/dummy/app/assets/images/rails.png +0 -0
  23. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  24. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  25. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  26. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  27. data/spec/dummy/app/mailers/.gitkeep +0 -0
  28. data/spec/dummy/app/models/.gitkeep +0 -0
  29. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/spec/dummy/config/application.rb +62 -0
  31. data/spec/dummy/config/boot.rb +6 -0
  32. data/spec/dummy/config/environment.rb +5 -0
  33. data/spec/dummy/config/environments/development.rb +37 -0
  34. data/spec/dummy/config/environments/production.rb +67 -0
  35. data/spec/dummy/config/environments/test.rb +37 -0
  36. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  37. data/spec/dummy/config/initializers/inflections.rb +15 -0
  38. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  39. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  40. data/spec/dummy/config/initializers/session_store.rb +8 -0
  41. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  42. data/spec/dummy/config/locales/en.yml +5 -0
  43. data/spec/dummy/config/routes.rb +58 -0
  44. data/spec/dummy/db/seeds.rb +7 -0
  45. data/spec/dummy/lib/assets/.gitkeep +0 -0
  46. data/spec/dummy/lib/tasks/.gitkeep +0 -0
  47. data/spec/dummy/log/.gitkeep +0 -0
  48. data/spec/dummy/script/rails +6 -0
  49. data/spec/dummy/vendor/assets/javascripts/.gitkeep +0 -0
  50. data/spec/dummy/vendor/assets/stylesheets/.gitkeep +0 -0
  51. metadata +150 -0
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use --create 1.9.3@sasspectations
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in sasspectations.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+
8
+ gem 'rails'
9
+ gem 'pry'
10
+
11
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 TODO: Write your name
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Sasspectations
2
+
3
+ Sasspectations is a rspec like spec runner for SCSS.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'sasspectations'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install sasspectations
18
+
19
+ ## Usage
20
+
21
+ Drop you Sasspectations specs into spec/scss and run:
22
+
23
+ $ rake sasspectations:run
24
+
25
+ Or you can specify a path, for example if you had your specs in examples/spec/scss:
26
+
27
+ $ rake sasspectations:run\[examples\]
28
+
29
+ ### Writing Sasspectations Specs
30
+ All Sasspectations specs are written in SCSS.
31
+
32
+
33
+ ## Acknowledgements/Thanks
34
+ Much thanks to the folks who built [Sassquatch](https://github.com/d-i/Sassquatch), without their inital work this wouldn't have been possiable. Many of their ideas were used in this project.
35
+
36
+
37
+
38
+ ## Contributing
39
+
40
+ 1. Fork it
41
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
43
+ 4. Push to the branch (`git push origin my-new-feature`)
44
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ load File.expand_path('../lib/tasks/sasspectations.rake', __FILE__)
@@ -0,0 +1,23 @@
1
+ @function strip-units($number) {
2
+ $unit: unit($number);
3
+ $one: 1px;
4
+ @if $unit == em {
5
+ $one: 1em;
6
+ } @else if $unit == px {
7
+ $one: 1px;
8
+ }
9
+ @return $number/$one;
10
+ }
11
+
12
+ @function to-px($em){
13
+ @return strip-units($em) * $base-size;
14
+ }
15
+
16
+ @function to-em($px,$context:1em){
17
+ @if unit($context) == em {
18
+ @return $px / to-px($context) * 1em;
19
+ } @else if unit($context) == px {
20
+ @return $px / $context * 1em;
21
+ }
22
+ }
23
+
@@ -0,0 +1,8 @@
1
+ // Functions we want to test
2
+
3
+ @function adding-numbers($a, $b) {
4
+ @return $a + $b;
5
+ }
6
+ @function multiply-numbers($a, $b) {
7
+ @return $a * $b;
8
+ }
@@ -0,0 +1,44 @@
1
+ spec-name {
2
+ // set any variables we need.
3
+ $base-size: 10px;
4
+ // import the scss files we want to test.
5
+ @import "../../functions";
6
+
7
+ strip-units {
8
+ remove-from-em {
9
+ expect: to-equal(strip-units(1em), 1);
10
+ }
11
+ }
12
+
13
+ to-px {
14
+ basic-conversion {
15
+ expect: to-equal(to-px(1em), 10px);
16
+ }
17
+ basic-conversion-not {
18
+ expect: to-not-equal(to-px(10em), 10px);
19
+ }
20
+ }
21
+
22
+ to-em {
23
+ basic-conversion {
24
+ expect: to-equal(to-em(10px), 1em);
25
+ }
26
+
27
+ convert-with-em-context {
28
+ expect: to-equal(to-em(10px, 2em), .5em);
29
+ }
30
+
31
+ convert-with-px-context {
32
+ expect: to-equal(to-em(10px, 20px), .5em);
33
+ }
34
+ }
35
+
36
+
37
+ has-text {
38
+ expect: to-contain('pi', 'pixel')
39
+ }
40
+
41
+ does-not-have-text {
42
+ expect: to-not-contain('p0', 'pixel')
43
+ }
44
+ }
@@ -0,0 +1,30 @@
1
+ maths-spec {
2
+ // import the scss files we want to test.
3
+ @import "../../maths";
4
+
5
+ greater-than {
6
+ expect: to-greater-than(5,4);
7
+ }
8
+
9
+ less-than {
10
+ expect: to-less-than(multiply-numbers(50,3),250);
11
+ }
12
+
13
+ divisible-by {
14
+ expect: to-divisible-by(adding-numbers(30,20), 10);
15
+ }
16
+
17
+ to-be-odd {
18
+ expect: to-be-odd(adding-numbers(6px,7px));
19
+ }
20
+
21
+ to-be-even {
22
+ expect: to-be-even(adding-numbers(5,7));
23
+ }
24
+
25
+
26
+ in-range {
27
+ expect: to-in-range(5,1,adding-numbers(6,6));
28
+ }
29
+
30
+ }
@@ -0,0 +1,7 @@
1
+ module Sasspectations
2
+
3
+ class Engine < Rails::Engine
4
+ engine_name 'sasspectations'
5
+ end
6
+
7
+ end
@@ -0,0 +1,27 @@
1
+ module Sasspectations
2
+
3
+ class OutputFormatter
4
+
5
+ def initialize(parser)
6
+ @parser = parser
7
+ @spec_results = parser.result
8
+ end
9
+
10
+ def display
11
+ puts "Running Scss specs:".colorize(:cyan)
12
+ @spec_results.each do |result|
13
+ print result.first
14
+ end
15
+ puts "" # newline
16
+ if @parser.failed?
17
+ puts "Failed Specs:".colorize(:red)
18
+
19
+ @spec_results.select { |r| r.first =~ /f/i }.each do |failed_result|
20
+ puts failed_result.last.colorize(:red)
21
+ end
22
+ end
23
+ end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,30 @@
1
+ module Sasspectations
2
+
3
+ class ResultParser
4
+
5
+ attr_accessor :result
6
+
7
+ # Assumes one spec result per line
8
+ #
9
+ def initialize(css_output)
10
+ @css_output = css_output
11
+ end
12
+
13
+ def parse
14
+ spec_lines = @css_output.split("\n").reject! &:empty?
15
+ @result = spec_lines.map do |spec_line|
16
+ if spec_line =~ /{\s*expect\s?:\s?true[;]?\s?}/
17
+ [".".colorize(:green), spec_line]
18
+ else
19
+ ["F".colorize(:red), spec_line]
20
+ end
21
+ end
22
+ end
23
+
24
+ def failed?
25
+ @result.any? { |r| r.first =~ /f/i }
26
+ end
27
+
28
+ end
29
+
30
+ end
@@ -0,0 +1,29 @@
1
+ module Sasspectations
2
+
3
+ class Runner
4
+
5
+ def initialize(root_path)
6
+ @root_path = root_path
7
+ end
8
+
9
+ def render
10
+ spec_files.map { |path| scss_file_to_css(path) }.join("\n\n")
11
+ end
12
+
13
+ private
14
+
15
+ def scss_file_to_css(scss_path)
16
+ Sass::Engine.for_file(scss_path, {syntax: :scss, style: :compact}).render
17
+ end
18
+
19
+ def spec_files
20
+ Dir[specs_path_glob]
21
+ end
22
+
23
+ def specs_path_glob
24
+ Pathname.new(@root_path).join('spec', 'scss', '**', '*_spec.scss')
25
+ end
26
+
27
+ end
28
+
29
+ end
@@ -0,0 +1,3 @@
1
+ module Sasspectations
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,12 @@
1
+ require "sass"
2
+ require "sasspectations_matchers"
3
+ require "colorize"
4
+
5
+ require "sasspectations/version"
6
+ require "sasspectations/runner"
7
+ require "sasspectations/result_parser"
8
+ require "sasspectations/output_formatter"
9
+
10
+ require "sasspectations/engine" if defined?(Rails)
11
+
12
+ module Sasspectations; end
@@ -0,0 +1,108 @@
1
+ module Sass::Script::Functions
2
+ module SasspectationsMatchers
3
+
4
+ def to_equal(actual, expected)
5
+ if expected.value == actual.value
6
+ pass
7
+ else
8
+ actual
9
+ end
10
+ end
11
+
12
+ def to_not_equal(actual, expected)
13
+ if expected.value != actual.value
14
+ pass
15
+ else
16
+ actual
17
+ end
18
+ end
19
+
20
+ # def to_almost_equal(actual, expected, variance=0.5)
21
+ # if (actual.value-expected.value) <= variance.value
22
+ # pass
23
+ # else
24
+ # actual
25
+ # end
26
+ # end
27
+
28
+ def to_greater_than(big, small)
29
+ if big.value > small.value
30
+ pass
31
+ else
32
+ big
33
+ end
34
+ end
35
+
36
+ def to_less_than(small, big)
37
+ if small.value < big.value
38
+ pass
39
+ else
40
+ small
41
+ end
42
+ end
43
+
44
+ def to_contain(search, string)
45
+ if string.value.include? search.value
46
+ pass
47
+ else
48
+ search
49
+ end
50
+ end
51
+
52
+ def to_not_contain(search, string)
53
+ if !string.value.include? search.value
54
+ pass
55
+ else
56
+ search
57
+ end
58
+ end
59
+
60
+ def to_divisible_by(base, divisible_by )
61
+ if base.value % divisible_by.value == 0
62
+ pass
63
+ else
64
+ base
65
+ end
66
+ end
67
+
68
+ def to_factor_of()
69
+ # TODO:
70
+ end
71
+
72
+
73
+ def to_be_odd(base)
74
+ if base.value % 2 != 0
75
+ pass
76
+ else
77
+ base
78
+ end
79
+ end
80
+
81
+ def to_be_even(base)
82
+ if base.value % 2 == 0
83
+ pass
84
+ else
85
+ base
86
+ end
87
+ end
88
+
89
+ def to_in_range(number, start_range, end_range)
90
+ if (number.value <= end_range.value) && (number.value >= start_range.value)
91
+ pass
92
+ else
93
+ number
94
+ end
95
+ end
96
+
97
+ private
98
+
99
+ def pass
100
+ Sass::Script::Bool.new(true)
101
+ end
102
+
103
+ end
104
+
105
+
106
+ include SasspectationsMatchers
107
+ end
108
+
@@ -0,0 +1,21 @@
1
+ $:.unshift(File.expand_path('../..', __FILE__)) unless $:.include? File.expand_path('../..', __FILE__)
2
+
3
+ require 'sasspectations'
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)
10
+
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
+ #
16
+ 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?
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sasspectations/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "sasspectations"
8
+ gem.version = Sasspectations::VERSION
9
+ gem.authors = ["Andrew Jaswa", "Jesse Trimble"]
10
+ gem.email = ["ajaswa@gmail.com", "jesse.trimble@factorylabs.com"]
11
+ gem.description = %q{Spec runner for Sass}
12
+ gem.summary = %q{Spec runner for Sass}
13
+ gem.homepage = ""
14
+
15
+ gem.add_dependency 'sass'
16
+ gem.add_dependency 'colorize'
17
+
18
+ gem.files = `git ls-files`.split($/)
19
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
+ gem.require_paths = ["lib"]
22
+ end
@@ -0,0 +1,15 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile ~/.gitignore_global
6
+
7
+ # Ignore bundler config
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+
13
+ # Ignore all logfiles and tempfiles.
14
+ /log/*.log
15
+ /tmp
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,62 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ if defined?(Bundler)
6
+ # If you precompile assets before deploying to production, use this line
7
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
8
+ # If you want your assets lazily compiled in production, use this line
9
+ # Bundler.require(:default, :assets, Rails.env)
10
+ end
11
+
12
+ module Dummy
13
+ class Application < Rails::Application
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration should go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded.
17
+
18
+ # Custom directories with classes and modules you want to be autoloadable.
19
+ # config.autoload_paths += %W(#{config.root}/extras)
20
+
21
+ # Only load the plugins named here, in the order given (default is alphabetical).
22
+ # :all can be used as a placeholder for all plugins not explicitly named.
23
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
+
25
+ # Activate observers that should always be running.
26
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
+
28
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
+ # config.time_zone = 'Central Time (US & Canada)'
31
+
32
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
+ # config.i18n.default_locale = :de
35
+
36
+ # Configure the default encoding used in templates for Ruby 1.9.
37
+ config.encoding = "utf-8"
38
+
39
+ # Configure sensitive parameters which will be filtered from the log file.
40
+ config.filter_parameters += [:password]
41
+
42
+ # Enable escaping HTML in JSON.
43
+ config.active_support.escape_html_entities_in_json = true
44
+
45
+ # Use SQL instead of Active Record's schema dumper when creating the database.
46
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
47
+ # like if you have constraints or database-specific column types
48
+ # config.active_record.schema_format = :sql
49
+
50
+ # Enforce whitelist mode for mass assignment.
51
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
52
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
53
+ # parameters by using an attr_accessible or attr_protected declaration.
54
+ config.active_record.whitelist_attributes = true
55
+
56
+ # Enable the asset pipeline
57
+ config.assets.enabled = true
58
+
59
+ # Version of your assets, change this if you want to expire all your assets
60
+ config.assets.version = '1.0'
61
+ end
62
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '28533a2ec53f5c885f6be2ede9364aaae33ed0a42835ce2c9c3fd6b67e8f0e8c83abdea700c13ec2f35559369b53445aa65fc401737862723859b61c092f0be9'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,58 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get 'short'
20
+ # post 'toggle'
21
+ # end
22
+ #
23
+ # collection do
24
+ # get 'sold'
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get 'recent', :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ # root :to => 'welcome#index'
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id))(.:format)'
58
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
File without changes
File without changes
metadata ADDED
@@ -0,0 +1,150 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sasspectations
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Andrew Jaswa
9
+ - Jesse Trimble
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-02-11 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: sass
17
+ requirement: &70204403532360 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *70204403532360
26
+ - !ruby/object:Gem::Dependency
27
+ name: colorize
28
+ requirement: &70204403531920 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *70204403531920
37
+ description: Spec runner for Sass
38
+ email:
39
+ - ajaswa@gmail.com
40
+ - jesse.trimble@factorylabs.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - .gitignore
46
+ - .rvmrc
47
+ - Gemfile
48
+ - LICENSE.txt
49
+ - README.md
50
+ - Rakefile
51
+ - examples/functions.scss
52
+ - examples/maths.scss
53
+ - examples/spec/scss/functions_spec.scss
54
+ - examples/spec/scss/math_spec.scss
55
+ - lib/sasspectations.rb
56
+ - lib/sasspectations/engine.rb
57
+ - lib/sasspectations/output_formatter.rb
58
+ - lib/sasspectations/result_parser.rb
59
+ - lib/sasspectations/runner.rb
60
+ - lib/sasspectations/version.rb
61
+ - lib/sasspectations_matchers.rb
62
+ - lib/tasks/sasspectations.rake
63
+ - sasspectations.gemspec
64
+ - spec/dummy/.gitignore
65
+ - spec/dummy/Rakefile
66
+ - spec/dummy/app/assets/images/rails.png
67
+ - spec/dummy/app/assets/javascripts/application.js
68
+ - spec/dummy/app/assets/stylesheets/application.css
69
+ - spec/dummy/app/controllers/application_controller.rb
70
+ - spec/dummy/app/helpers/application_helper.rb
71
+ - spec/dummy/app/mailers/.gitkeep
72
+ - spec/dummy/app/models/.gitkeep
73
+ - spec/dummy/app/views/layouts/application.html.erb
74
+ - spec/dummy/config/application.rb
75
+ - spec/dummy/config/boot.rb
76
+ - spec/dummy/config/environment.rb
77
+ - spec/dummy/config/environments/development.rb
78
+ - spec/dummy/config/environments/production.rb
79
+ - spec/dummy/config/environments/test.rb
80
+ - spec/dummy/config/initializers/backtrace_silencers.rb
81
+ - spec/dummy/config/initializers/inflections.rb
82
+ - spec/dummy/config/initializers/mime_types.rb
83
+ - spec/dummy/config/initializers/secret_token.rb
84
+ - spec/dummy/config/initializers/session_store.rb
85
+ - spec/dummy/config/initializers/wrap_parameters.rb
86
+ - spec/dummy/config/locales/en.yml
87
+ - spec/dummy/config/routes.rb
88
+ - spec/dummy/db/seeds.rb
89
+ - spec/dummy/lib/assets/.gitkeep
90
+ - spec/dummy/lib/tasks/.gitkeep
91
+ - spec/dummy/log/.gitkeep
92
+ - spec/dummy/script/rails
93
+ - spec/dummy/vendor/assets/javascripts/.gitkeep
94
+ - spec/dummy/vendor/assets/stylesheets/.gitkeep
95
+ homepage: ''
96
+ licenses: []
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ none: false
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 1.8.15
116
+ signing_key:
117
+ specification_version: 3
118
+ summary: Spec runner for Sass
119
+ test_files:
120
+ - spec/dummy/.gitignore
121
+ - spec/dummy/Rakefile
122
+ - spec/dummy/app/assets/images/rails.png
123
+ - spec/dummy/app/assets/javascripts/application.js
124
+ - spec/dummy/app/assets/stylesheets/application.css
125
+ - spec/dummy/app/controllers/application_controller.rb
126
+ - spec/dummy/app/helpers/application_helper.rb
127
+ - spec/dummy/app/mailers/.gitkeep
128
+ - spec/dummy/app/models/.gitkeep
129
+ - spec/dummy/app/views/layouts/application.html.erb
130
+ - spec/dummy/config/application.rb
131
+ - spec/dummy/config/boot.rb
132
+ - spec/dummy/config/environment.rb
133
+ - spec/dummy/config/environments/development.rb
134
+ - spec/dummy/config/environments/production.rb
135
+ - spec/dummy/config/environments/test.rb
136
+ - spec/dummy/config/initializers/backtrace_silencers.rb
137
+ - spec/dummy/config/initializers/inflections.rb
138
+ - spec/dummy/config/initializers/mime_types.rb
139
+ - spec/dummy/config/initializers/secret_token.rb
140
+ - spec/dummy/config/initializers/session_store.rb
141
+ - spec/dummy/config/initializers/wrap_parameters.rb
142
+ - spec/dummy/config/locales/en.yml
143
+ - spec/dummy/config/routes.rb
144
+ - spec/dummy/db/seeds.rb
145
+ - spec/dummy/lib/assets/.gitkeep
146
+ - spec/dummy/lib/tasks/.gitkeep
147
+ - spec/dummy/log/.gitkeep
148
+ - spec/dummy/script/rails
149
+ - spec/dummy/vendor/assets/javascripts/.gitkeep
150
+ - spec/dummy/vendor/assets/stylesheets/.gitkeep