frameworks-capybara 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.17
1
+ 0.1.18
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{frameworks-capybara}
8
- s.version = "0.1.17"
8
+ s.version = "0.1.18"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcrmfc"]
12
- s.date = %q{2012-03-05}
12
+ s.date = %q{2012-03-27}
13
13
  s.description = %q{gem to aid setup of Capybara for testing bbc sites}
14
14
  s.email = %q{mcrobbins@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -17,21 +17,22 @@ module Frameworks
17
17
  include W3CValidators
18
18
  #Generate base urls to use in Cucumber step defs
19
19
  def generate_base_urls
20
+ environment = ENV['ENVIRONMENT'].downcase #be defensive
20
21
  set_scheme
21
- if(ENV['ENVIRONMENT']=='sandbox')
22
+ if(environment =='sandbox')
22
23
  @base_url = @sandbox + @bbc_domain
23
24
  @static_base_url = @static_sandbox + @bbc_domain
24
- elsif (ENV['ENVIRONMENT']=='live' && ENV['WWW_LIVE']=='false')
25
+ elsif (environment =='live' && ENV['WWW_LIVE']=='false')
25
26
  @base_url = @www_prefix.chop + @bbc_domain
26
27
  @static_base_url = @static_prefix.chop + @bbci_domain
27
28
  @open_base_url = @open_prefix.chop + @bbc_domain
28
- elsif (ENV['ENVIRONMENT'].split('.')[0].include? 'pal') #address specific box
29
+ elsif (environment.split('.')[0].include? 'pal') #address specific box
29
30
  @base_url = "#{scheme}://#{ENV['ENVIRONMENT']}"
30
31
  else
31
- @base_url = @www_prefix + ENV['ENVIRONMENT'] + @bbc_domain
32
- @static_base_url = @static_prefix + ENV['ENVIRONMENT'] + @bbci_domain
33
- @static_base_url = @static_prefix.chop + @bbci_domain if ENV['ENVIRONMENT'] == 'live'
34
- @open_base_url = @open_prefix + ENV['ENVIRONMENT'] + @bbc_domain
32
+ @base_url = @www_prefix + environment + @bbc_domain
33
+ @static_base_url = @static_prefix + environment + @bbci_domain
34
+ @static_base_url = @static_prefix.chop + @bbci_domain if environment == 'live'
35
+ @open_base_url = @open_prefix + environment + @bbc_domain
35
36
  end
36
37
  proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
37
38
  @proxy_host = proxy.scan(/http:\/\/(.*):80/).to_s if proxy
@@ -32,8 +32,25 @@ describe Frameworks::EnvHelper do
32
32
  @open_base_url.should == 'http://open.live.bbc.co.uk'
33
33
  end
34
34
 
35
- it "should be able to set a 'classic' live url" do
36
- ENV['ENVIRONMENT'] = 'live'
35
+ it "should be able to set a base url and not be case sensitive" do
36
+ ENV['ENVIRONMENT'] = 'fOo'
37
+ generate_base_urls
38
+ @base_url.should == 'http://www.foo.bbc.co.uk'
39
+ @static_base_url.should == 'http://static.foo.bbci.co.uk'
40
+ @open_base_url.should == 'http://open.foo.bbc.co.uk'
41
+ end
42
+
43
+ it "should set correct static base for www.live.bbc.co.uk and not be case sensitive" do
44
+ ENV['ENVIRONMENT'] = 'LiVe'
45
+ generate_base_urls
46
+ @base_url.should == 'http://www.live.bbc.co.uk'
47
+ @static_base_url.should == 'http://static.bbci.co.uk'
48
+ @open_base_url.should == 'http://open.live.bbc.co.uk'
49
+ end
50
+
51
+
52
+ it "should be able to set a 'classic' live url and not be case sensitive" do
53
+ ENV['ENVIRONMENT'] = 'Live'
37
54
  ENV['WWW_LIVE'] = 'false'
38
55
  generate_base_urls
39
56
  @base_url.should == 'http://www.bbc.co.uk'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frameworks-capybara
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 17
10
- version: 0.1.17
9
+ - 18
10
+ version: 0.1.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - mcrmfc
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-05 00:00:00 +00:00
18
+ date: 2012-03-27 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency