Skip to content

Commit 158cb32

Browse files
committed
Spec sandbox rake task
1 parent 6e5d218 commit 158cb32

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ jobs:
1717
with:
1818
ruby-version: 2.7
1919
- run: bundle install
20-
- run: VCR=off bundle exec rake
20+
- run: rake spec:sandbox
21+
- run: rake rubocop

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,8 @@ rspec --tag integration
237237
```
238238

239239
By default, this runs the integration tests against [VCR recordings](https://github.com/vcr/vcr) of the Sandbox API with an official CloudConvert account.
240-
If you would like to use your own account, you can set your API key using the `CLOUDCONVERT_API_KEY` environment variable.
240+
If you would like to use your own account, you can set your API key using the `CLOUDCONVERT_API_KEY` environment variable and disable VCR with `VCR=off` or by using the `rake spec:sandbox` task.
241241
In this case you need to whitelist the following MD5 hashes for Sandbox API (using the CloudConvert dashboard).
242-
If you want the tests to do real web requests pass `VCR=off`.
243242

244243
```
245244
53d6fe6b688c31c565907c81de625046 input.pdf

Rakefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@ require "bundler/gem_tasks"
33
require "rspec/core/rake_task"
44
RSpec::Core::RakeTask.new(:spec)
55

6+
namespace :spec do
7+
RSpec::Core::RakeTask.new(:integration) do |t|
8+
t.rspec_opts = "--tag integration"
9+
end
10+
11+
RSpec::Core::RakeTask.new(:sandbox) do |t|
12+
ENV["VCR"] = "off"
13+
end
14+
15+
RSpec::Core::RakeTask.new(:unit) do |t|
16+
t.rspec_opts = "--tag unit"
17+
end
18+
19+
RSpec::Core::RakeTask.new(:vcr)
20+
end
21+
622
require "rubocop/rake_task"
723
RuboCop::RakeTask.new
824

0 commit comments

Comments
 (0)