spec/spec_helper.rb in card-1.19.0 vs spec/spec_helper.rb in card-1.19.1

- old
+ new

@@ -9,12 +9,14 @@ require File.expand_path("../../db/seed/test/seed.rb", __FILE__) require File.expand_path("../../config/simplecov_helper.rb", __FILE__) require "simplecov" -require File.expand_path("../../mod/machines/spec/lib/shared_machine_examples.rb", __FILE__) -require File.expand_path("../../mod/machines/spec/lib/shared_machine_input_examples.rb", __FILE__) +require File.expand_path("../../mod/machines/spec/lib/"\ + "shared_machine_examples.rb", __FILE__) +require File.expand_path("../../mod/machines/spec/lib/"\ + "shared_machine_input_examples.rb", __FILE__) Spork.prefork do if ENV["RAILS_ROOT"] require File.join(ENV["RAILS_ROOT"], "/config/environment") else @@ -35,11 +37,11 @@ RSpec.configure do |config| config.include RSpec::Rails::Matchers::RoutingMatchers, file_path: %r{\bspec/controllers/} config.include RSpecHtmlMatchers # format_index = ARGV.find_index {|arg| arg =~ /--format|-f/ } - # formatter = format_index ? ARGV[ format_index + 1 ] : 'documentation' #'textmate' + # formatter = format_index ? ARGV[ format_index + 1 ] : 'documentation' # config.default_formatter=formatter config.infer_spec_type_from_file_location! # config.include CustomMatchers # config.include ControllerMacros, type: :controllers @@ -74,9 +76,19 @@ end Card["*all+*style"].ensure_machine_output Card["*all+*script"].ensure_machine_output (ie9 = Card[:script_html5shiv_printshiv]) && ie9.ensure_machine_output + +def bucket_credentials key + @buckets ||= begin + yml_file = + ENV["BUCKET_CREDENTIALS_PATH"] || + File.expand_path("../config/bucket_credentials.yml", __FILE__) + File.exist?(yml_file) ? YAML.load_file(yml_file).deep_symbolize_keys : {} + end + @buckets[key] +end Spork.each_run do # This code will be run each time you run your specs. end