swinger 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/README.textile +1 -1
- data/lib/swinger.rb +1 -0
- data/spec/swinger_spec.rb +16 -7
- data/swinger.gemspec +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README.textile
CHANGED
@@ -3,7 +3,7 @@ h1. Swinger
|
|
3
3
|
Swinger is a really simple "Capybara":http://github.com/jnicklas/capybara extension that aims to make driver switching in "RSpec":http://github.com/rspec/rspec a bit less horrible to look at. Using the new metadata feature in RSpec 2, you can simply set your @:driver@ per scenario or context:
|
4
4
|
|
5
5
|
<pre><code>
|
6
|
-
# `scenario` is an alias for `it
|
6
|
+
# `scenario` is an alias for `it`, provided by Steak
|
7
7
|
|
8
8
|
scenario 'get a nice greeting', :driver => :selenium do
|
9
9
|
visit homepage
|
data/lib/swinger.rb
CHANGED
data/spec/swinger_spec.rb
CHANGED
@@ -22,19 +22,28 @@ describe 'Swinger' do
|
|
22
22
|
|
23
23
|
describe Capybara do
|
24
24
|
|
25
|
+
before do
|
26
|
+
Capybara.current_driver.should_not == :selenium
|
27
|
+
end
|
28
|
+
|
25
29
|
it 'should set the driver using Capybara.current_driver=' do
|
26
|
-
|
27
|
-
Capybara.using_driver(:selenium) {}
|
30
|
+
driver = nil
|
31
|
+
Capybara.using_driver(:selenium) { driver = Capybara.current_driver }
|
32
|
+
driver.should == :selenium
|
28
33
|
end
|
29
34
|
|
30
|
-
it 'should reset the driver using Capybara.use_default_driver' do
|
31
|
-
|
32
|
-
|
35
|
+
it 'should reset the driver using Capybara.use_default_driver, even if an exception occurs' do
|
36
|
+
begin
|
37
|
+
Capybara.using_driver(:selenium) { raise "ohnoes!" }
|
38
|
+
rescue Exception
|
39
|
+
end
|
40
|
+
Capybara.current_driver.should == Capybara.default_driver
|
33
41
|
end
|
34
42
|
|
35
43
|
it 'should yield the passed block' do
|
36
|
-
|
37
|
-
Capybara.using_driver(:selenium) {
|
44
|
+
called = false
|
45
|
+
Capybara.using_driver(:selenium) { called = true }
|
46
|
+
called.should == true
|
38
47
|
end
|
39
48
|
|
40
49
|
end
|
data/swinger.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swinger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeff Kreeftmeijer
|