Skip to content
Newer
Older
100644 71 lines (55 sloc) 2.33 KB
e57ae60 @myronmarston Updated Gemfile/gemspec/Rakefile, etc to use latest best practices ba…
authored Aug 26, 2010
1 require 'bundler'
2 require 'bundler/setup'
3 Bundler::GemHelper.install_tasks
4
d2577f7 @myronmarston Initial commit to vcr.
authored Feb 24, 2010
5 require 'rake'
f05cc59 @myronmarston Upgrade to rspec-2.
authored Jul 22, 2010
6 require "rspec/core/rake_task"
d2577f7 @myronmarston Initial commit to vcr.
authored Feb 25, 2010
7
4ed657f @myronmarston Make it easy to temporarily use documentation format for the specs.
authored Aug 21, 2010
8 RSpec::Core::RakeTask.new(:spec) do |t|
9 #t.spec_opts = %w[--format documentation]
10 end
f05cc59 @myronmarston Upgrade to rspec-2.
authored Jul 23, 2010
11
12 desc "Run all examples using rcov"
13 RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
14 t.rcov = true
15 t.rcov_opts = %[-Ilib -Ispec --exclude "spec/*,gems/*" --text-report --sort coverage --aggregate coverage.data]
16 end
17
18 task :cleanup_rcov_files do
19 rm_rf 'coverage.data'
d2577f7 @myronmarston Initial commit to vcr.
authored Feb 25, 2010
20 end
21
22 begin
05bbce0 @myronmarston Refactored rakefile so that we have features:fakeweb and features:web…
authored Jun 21, 2010
23 permutations = {
24 'fakeweb' => %w( net/http ),
a40025f @myronmarston Updated em-http-request to 0.2.10.
authored Aug 7, 2010
25 'webmock' => %w( net/http httpclient patron em-http-request )
05bbce0 @myronmarston Refactored rakefile so that we have features:fakeweb and features:web…
authored Jun 22, 2010
26 }
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 10, 2010
27
d2577f7 @myronmarston Initial commit to vcr.
authored Feb 25, 2010
28 require 'cucumber/rake/task'
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 11, 2010
29 namespace :features do
05bbce0 @myronmarston Refactored rakefile so that we have features:fakeweb and features:web…
authored Jun 22, 2010
30 permutations.each do |http_stubbing_adapter, http_libraries|
31 features_subtasks = []
32
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 11, 2010
33 namespace http_stubbing_adapter do
34 http_libraries.each do |http_lib|
a40025f @myronmarston Updated em-http-request to 0.2.10.
authored Aug 7, 2010
35 next if RUBY_PLATFORM =~ /java/ && %w( patron em-http-request ).include?(http_lib)
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 11, 2010
36
37 sanitized_http_lib = http_lib.gsub('/', '_')
38 features_subtasks << "features:#{http_stubbing_adapter}:#{sanitized_http_lib}"
39
a01d539 @myronmarston Removed check_dependencies rake task. It's no longer necessary with b…
authored Jul 6, 2010
40 task "#{sanitized_http_lib}_prep" do
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 11, 2010
41 ENV['HTTP_STUBBING_ADAPTER'] = http_stubbing_adapter
42 ENV['HTTP_LIB'] = http_lib
43 end
44
45 Cucumber::Rake::Task.new(
46 { sanitized_http_lib => "#{features_subtasks.last}_prep" },
47 "Run the features using #{http_stubbing_adapter} and #{http_lib}") do |t|
9a98992 @myronmarston Added some failing scenarios for the new :match_requests_on feature I…
authored Aug 6, 2010
48 t.cucumber_opts = ['--format', 'progress', '--tags', "@#{http_stubbing_adapter},@all_http_libs,@#{sanitized_http_lib}"]
acc398b @myronmarston Disable cucumber scenarios that can't pass on heroku due to heroku's …
authored Jun 21, 2010
49
50 # disable scenarios on heroku that can't pass due to heroku's restrictions
51 t.cucumber_opts += ['--tags', '~@spawns_localhost_server'] if ENV.keys.include?('HEROKU_SLUG')
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 11, 2010
52 end
53 end
54 end
05bbce0 @myronmarston Refactored rakefile so that we have features:fakeweb and features:web…
authored Jun 22, 2010
55
56 desc "Run the features using #{http_stubbing_adapter} and each of #{http_stubbing_adapter}'s supported http libraries"
57 task http_stubbing_adapter => features_subtasks
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 11, 2010
58 end
59 end
60
61 desc "Run the features using each supported permutation of http stubbing library and http library."
05bbce0 @myronmarston Refactored rakefile so that we have features:fakeweb and features:web…
authored Jun 22, 2010
62 task :features => permutations.keys.map { |a| "features:#{a}" }
d2577f7 @myronmarston Initial commit to vcr.
authored Feb 25, 2010
63 rescue LoadError
64 task :features do
65 abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
66 end
67 end
68
b1926ca @myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
authored Jun 11, 2010
69 task :default => [:spec, :features]
d2577f7 @myronmarston Initial commit to vcr.
authored Feb 25, 2010
70
Something went wrong with that request. Please try again.