capybara-firebug 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  *.gem
2
2
  .bundle
3
+ .rvmrc
3
4
  Gemfile.lock
4
5
  pkg/*
data/README.md CHANGED
@@ -12,7 +12,16 @@ You'll want to be able to pause the scenario at some point to inspect things
12
12
  in Firebug. A step definition for `Then stop and let me debug` is provided
13
13
  for this purpose. When executed, it breaks in the Ruby debugger.
14
14
 
15
- == Customizing the Profile ==
15
+ ## Using Firefox 4 and Firebug 1.7.0
16
+
17
+ If you want to use Firefox 4 with Firebug 1.7.0, configure the firebug_version
18
+ setting in your `capybara.rb` support file
19
+
20
+ # located in features/support/capybara.rb or similar
21
+ require 'capybara/firebug'
22
+ Selenium::WebDriver::Firefox::Profile.firebug_version = '1.7.0'
23
+
24
+ ## Customizing the Profile
16
25
 
17
26
  If you wish to further customize the Firefox profile used by selenium, you
18
27
  can use the `#enable_firebug` method to add the Firebug extension to it:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "capybara-firebug"
5
- s.version = "0.0.4"
5
+ s.version = "0.0.5"
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ["John Firebaugh"]
8
8
  s.email = ["john.firebaugh@gmail.com"]
@@ -1,7 +1,16 @@
1
1
  require 'selenium/webdriver'
2
2
 
3
3
  class Selenium::WebDriver::Firefox::Profile
4
- def enable_firebug(version = "1.6.2")
4
+ def self.firebug_version
5
+ @firebug_version ||= '1.6.2'
6
+ end
7
+
8
+ def self.firebug_version=(version)
9
+ @firebug_version = version
10
+ end
11
+
12
+ def enable_firebug(version = nil)
13
+ version ||= Selenium::WebDriver::Firefox::Profile.firebug_version
5
14
  add_extension(File.expand_path("../firebug-#{version}.xpi", __FILE__))
6
15
 
7
16
  # Prevent "Welcome!" tab
@@ -1,13 +1,39 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Selenium::WebDriver::Firefox::Profile, "#enable_firebug" do
4
- it "adds the Firebug extension" do
5
- subject.should_receive(:add_extension).with(/firebug-1\.6\.2\.xpi$/)
6
- subject.enable_firebug
3
+ describe Selenium::WebDriver::Firefox::Profile do
4
+ describe ".firebug_version" do
5
+ subject { described_class.firebug_version }
6
+
7
+ it "defaults to 1.6.2" do
8
+ should == "1.6.2"
9
+ end
10
+
11
+ context "when set" do
12
+ before { described_class.firebug_version = requested_version }
13
+
14
+ let(:requested_version) { '1.7.0' }
15
+
16
+ it { should == requested_version }
17
+ end
7
18
  end
8
19
 
9
- it "accepts an optional version argument" do
10
- subject.should_receive(:add_extension).with(/firebug-1\.7\.0\.xpi$/)
11
- subject.enable_firebug("1.7.0")
20
+ describe "#enable_firebug" do
21
+ before { Selenium::WebDriver::Firefox::Profile.firebug_version = nil }
22
+
23
+ it "adds the Firebug extension" do
24
+ subject.should_receive(:add_extension).with(/firebug-1\.6\.2\.xpi$/)
25
+ subject.enable_firebug
26
+ end
27
+
28
+ it "honors the configured version" do
29
+ Selenium::WebDriver::Firefox::Profile.firebug_version = '1.7.0'
30
+ subject.should_receive(:add_extension).with(/firebug-1\.7\.0\.xpi$/)
31
+ subject.enable_firebug
32
+ end
33
+
34
+ it "accepts an optional version argument" do
35
+ subject.should_receive(:add_extension).with(/firebug-1\.7\.0\.xpi$/)
36
+ subject.enable_firebug("1.7.0")
37
+ end
12
38
  end
13
39
  end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-firebug
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 4
9
- version: 0.0.4
4
+ prerelease:
5
+ version: 0.0.5
10
6
  platform: ruby
11
7
  authors:
12
8
  - John Firebaugh
@@ -14,8 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-03-30 00:00:00 -07:00
18
- default_executable:
13
+ date: 2011-04-23 00:00:00 Z
19
14
  dependencies:
20
15
  - !ruby/object:Gem::Dependency
21
16
  name: capybara
@@ -25,11 +20,6 @@ dependencies:
25
20
  requirements:
26
21
  - - ~>
27
22
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 4
31
- - 1
32
- - 2
33
23
  version: 0.4.1.2
34
24
  type: :runtime
35
25
  version_requirements: *id001
@@ -41,9 +31,6 @@ dependencies:
41
31
  requirements:
42
32
  - - ~>
43
33
  - !ruby/object:Gem::Version
44
- segments:
45
- - 2
46
- - 0
47
34
  version: "2.0"
48
35
  type: :development
49
36
  version_requirements: *id002
@@ -55,10 +42,6 @@ dependencies:
55
42
  requirements:
56
43
  - - ~>
57
44
  - !ruby/object:Gem::Version
58
- segments:
59
- - 0
60
- - 10
61
- - 0
62
45
  version: 0.10.0
63
46
  type: :development
64
47
  version_requirements: *id003
@@ -90,7 +73,6 @@ files:
90
73
  - lib/capybara/firebug.rb
91
74
  - spec/enable_firebug_spec.rb
92
75
  - spec/spec_helper.rb
93
- has_rdoc: true
94
76
  homepage: https://github.com/jfirebaugh/capybara-firebug
95
77
  licenses: []
96
78
 
@@ -104,21 +86,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
86
  requirements:
105
87
  - - ">="
106
88
  - !ruby/object:Gem::Version
107
- segments:
108
- - 0
109
89
  version: "0"
110
90
  required_rubygems_version: !ruby/object:Gem::Requirement
111
91
  none: false
112
92
  requirements:
113
93
  - - ">="
114
94
  - !ruby/object:Gem::Version
115
- segments:
116
- - 0
117
95
  version: "0"
118
96
  requirements: []
119
97
 
120
98
  rubyforge_project: capybara-firebug
121
- rubygems_version: 1.3.7
99
+ rubygems_version: 1.7.2
122
100
  signing_key:
123
101
  specification_version: 3
124
102
  summary: Run selenium with Firebug enabled
@@ -128,3 +106,4 @@ test_files:
128
106
  - features/support/env.rb
129
107
  - spec/enable_firebug_spec.rb
130
108
  - spec/spec_helper.rb
109
+ has_rdoc: