proxy_tester 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proxy_tester (0.0.5)
4
+ proxy_tester (0.0.7)
5
5
  activerecord (~> 4.0)
6
6
  activesupport (~> 4.0)
7
7
  addressable
data/README.md CHANGED
@@ -597,6 +597,44 @@ it 'blocks www.example.org' do
597
597
  end
598
598
  ```
599
599
 
600
+ ### Custom matchers
601
+
602
+ * have_requests_with_status_code
603
+
604
+ Checks if a page requested other objects with given status code(s). Because
605
+ some sites support `chunked` data, the status code needs to be an array.
606
+
607
+ ```ruby
608
+ it 'requested given resources' do
609
+ use_proxy 'proxy1.localdomain:8080'
610
+ use_user 'user1', :ask_password
611
+
612
+ visit 'http://www.example.org'
613
+
614
+ domains_with_status_code = {
615
+ 'http://www.example.org' => [200],
616
+ }
617
+
618
+ expect(page).to have_requests_with_status_code domains_with_status_code
619
+ end
620
+ ```
621
+
622
+ * reference_domains
623
+
624
+ Checks if a page requested objects from given domains.
625
+
626
+ ```ruby
627
+ it 'requested given resources' do
628
+ use_proxy 'proxy1.localdomain:8080'
629
+ use_user 'user1', :ask_password
630
+
631
+ visit 'http://www.example.org'
632
+ domains = %w{ www.example.org }
633
+
634
+ expect(page).to reference_domains domains
635
+ end
636
+ ```
637
+
600
638
  ## Writing Configuration File
601
639
  <a name="write_config"></a>
602
640
 
@@ -21,7 +21,8 @@ module ProxyTester
21
21
  options << '--color'
22
22
  options = options + ['--format', 'Fuubar' ]
23
23
  options = options + ['--order', 'rand' ]
24
- options = options + tags.collect { |t| "--tag #{t}" }
24
+
25
+ tags.each { |t| options << '--tag'; options << t }
25
26
 
26
27
  $LOAD_PATH << test_cases_directory
27
28
  RSpec::Core::Runner.run(options + spec_files)
@@ -1,4 +1,4 @@
1
1
  #main ProxyTester
2
2
  module ProxyTester
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
  end
data/script/ci CHANGED
@@ -1,3 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
+ bundle exec script/test_web &
4
+
3
5
  bundle exec rake test:coveralls
6
+
7
+ pkill -P $$
data/script/test_web CHANGED
@@ -1,13 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'sinatra'
3
+ require 'sinatra/base'
4
4
 
5
5
  class Webserver < Sinatra::Base
6
6
  enable :protection
7
-
8
- get '/:name' do
9
- File.read(File.expand_path("../../files/test/#{params[:name]}", __FILE__))
10
- end
7
+ set :logging, :true
11
8
 
12
9
  post '/rspec/:test' do
13
10
  case params[:test]
@@ -21,5 +18,6 @@ class Webserver < Sinatra::Base
21
18
  get '/rspec/:test' do
22
19
  params[:test]
23
20
  end
24
-
25
21
  end
22
+
23
+ Webserver.run!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxy_tester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-03 00:00:00.000000000 Z
12
+ date: 2014-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -373,7 +373,6 @@ files:
373
373
  - spec/spec_helper.rb
374
374
  - spec/support/capybara.rb
375
375
  - spec/support/database_cleaner.rb
376
- - spec/support/debugging.rb
377
376
  - spec/support/environment.rb
378
377
  - spec/support/example.rb
379
378
  - spec/support/factory_girl.rb
@@ -452,7 +451,6 @@ test_files:
452
451
  - spec/spec_helper.rb
453
452
  - spec/support/capybara.rb
454
453
  - spec/support/database_cleaner.rb
455
- - spec/support/debugging.rb
456
454
  - spec/support/environment.rb
457
455
  - spec/support/example.rb
458
456
  - spec/support/factory_girl.rb
@@ -1,3 +0,0 @@
1
- # encoding: utf-8
2
- require 'pry'
3
- require 'debugger'