Skip to content

Commit

Permalink
Improve dev tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Brice Sanchez committed May 26, 2016
1 parent 266f585 commit 4d8c20a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REFINERYCMS_API_TOKEN=
REFINERYCMS_API_URL=
REFINERYCMS_API_PATH=
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in refinery-api.gemspec
gemspec

group :development, :test do
gem 'dotenv'
end
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GEM
crack (0.4.3)
safe_yaml (~> 1.0.0)
diff-lcs (1.2.5)
dotenv (2.1.1)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
hashdiff (0.3.0)
Expand Down Expand Up @@ -48,6 +49,7 @@ PLATFORMS

DEPENDENCIES
bundler (~> 1.11)
dotenv
pry
rake (~> 10.0)
refinerycms-api-wrapper!
Expand All @@ -56,4 +58,4 @@ DEPENDENCIES
webmock

BUNDLED WITH
1.12.3
1.12.4
16 changes: 13 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
require 'refinery/api'
require 'vcr'
require 'pry'
require 'dotenv'
Dotenv.load

require "support/request_helpers"

ENV['REFINERYCMS_API_TOKEN'] ||= '123'
ENV['REFINERYCMS_API_URL'] ||= 'http://localhost:3000'
ENV['REFINERYCMS_API_PATH'] ||= '/api/v1'

VCR.configure do |c|
c.cassette_library_dir = 'spec/support/vcr_cassettes'
c.hook_into :webmock

c.filter_sensitive_data("REFINERYCMS_API_TOKEN") { ENV["REFINERYCMS_API_TOKEN"] }
c.filter_sensitive_data("REFINERYCMS_API_URL") { ENV["REFINERYCMS_API_URL"] }
c.filter_sensitive_data("REFINERYCMS_API_PATH") { ENV["REFINERYCMS_API_PATH"] }
end

RSpec.configure do |config|
Expand All @@ -18,9 +28,9 @@

config.before(:each) do
Refinery::API.configure do |conf|
conf.api_token = "123"
conf.api_url = "http://localhost:3000"
conf.api_path = "/api/v1"
conf.api_token = ENV["REFINERYCMS_API_TOKEN"]
conf.api_url = ENV["REFINERYCMS_API_URL"]
conf.api_path = ENV["REFINERYCMS_API_PATH"]
end
end
end

0 comments on commit 4d8c20a

Please sign in to comment.