filet-capybara 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in filet-capybara.gemspec
4
+ gemspec
5
+
6
+ unless ENV["TRAVIS"]
7
+ gem 'ruby-debug19', :platforms => :ruby_19
8
+ gem 'ruby-debug', :platforms => :mri_18
9
+ end
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake'
3
+ require 'rake/testtask'
4
+
5
+ task :default => :test
6
+
7
+ Rake::TestTask.new do |t|
8
+ t.libs << 'test'
9
+ t.test_files = FileList['test/**/*_test.rb']
10
+ t.verbose = true
11
+ end
data/Readme.md ADDED
@@ -0,0 +1,15 @@
1
+ # Filet Capybara
2
+
3
+ Filet Capybara provides out of the box integration of filet and capybara
4
+
5
+ ## Installation
6
+
7
+ gem install filet-capybara
8
+
9
+ ## Usage
10
+
11
+ To use just require the gem in your test_helper
12
+
13
+ ```ruby
14
+ require 'filet-capybara'
15
+ ```
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "filet-capybara/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "filet-capybara"
7
+ s.version = Filet::Capybara::VERSION
8
+ s.authors = ["Jorge Dias"]
9
+ s.email = ["jorge@mrdias.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Filet integration with capybara}
12
+ s.description = %q{Provides out of the box integration of capybara and filet}
13
+
14
+ s.rubyforge_project = "filet-capybara"
15
+
16
+ s.add_dependency('filet', '~>0.2.1')
17
+ s.add_dependency('capybara', '~>1.0.0')
18
+
19
+ s.add_development_dependency('rake')
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
+ s.require_paths = ["lib"]
25
+ end
@@ -0,0 +1,18 @@
1
+ module Filet
2
+ module Capybara
3
+ module Javascript
4
+ def self.included(base)
5
+ base.class_eval %{
6
+ background do
7
+ ::Capybara.current_driver = ::Capybara.javascript_driver
8
+ end
9
+
10
+ teardown do
11
+ ::Capybara.reset_sessions!
12
+ ::Capybara.use_default_driver
13
+ end
14
+ }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ module Filet
2
+ module Capybara
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,20 @@
1
+ require "filet-capybara/version"
2
+ require "filet-capybara/javascript"
3
+
4
+ require "capybara"
5
+ require "capybara/dsl"
6
+
7
+ require "filet"
8
+
9
+ Filet.feature_hook do |base, options|
10
+ base.send :include, ::Capybara::DSL
11
+ base.send(:include, Filet::Capybara::Javascript) if options[:js]
12
+ end
13
+
14
+ Filet.context_hook do |base, options|
15
+ base.send(:include, Filet::Capybara::Javascript) if options[:js]
16
+ end
17
+
18
+ include Filet
19
+
20
+
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+
3
+ feature "Capybara Integration", %{
4
+ As a mantainer of filet
5
+ I want to make it easier to integrate with Capybara
6
+ In order to get more users for the project
7
+ } do
8
+
9
+ scenario "features should include the capybara dsl" do
10
+ assert self.class.ancestors.include?(Capybara::DSL)
11
+ end
12
+
13
+ context "javascript integration", :js => true do
14
+ scenario "scenario driver is the javascript_driver" do
15
+ assert_equal Capybara.javascript_driver, Capybara.current_driver
16
+ end
17
+
18
+ scenario "after teardown the driver is the default" do
19
+ assert_not_equal Capybara.default_driver, Capybara.current_driver
20
+ teardown
21
+ assert_equal Capybara.default_driver, Capybara.current_driver
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,4 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'test/unit'
4
+ require 'filet-capybara'
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: filet-capybara
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Jorge Dias
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-08-24 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: filet
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 21
30
+ segments:
31
+ - 0
32
+ - 2
33
+ - 1
34
+ version: 0.2.1
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: capybara
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ hash: 23
46
+ segments:
47
+ - 1
48
+ - 0
49
+ - 0
50
+ version: 1.0.0
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: rake
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ type: :development
66
+ version_requirements: *id003
67
+ description: Provides out of the box integration of capybara and filet
68
+ email:
69
+ - jorge@mrdias.com
70
+ executables: []
71
+
72
+ extensions: []
73
+
74
+ extra_rdoc_files: []
75
+
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - Rakefile
80
+ - Readme.md
81
+ - filet-capybara.gemspec
82
+ - lib/filet-capybara.rb
83
+ - lib/filet-capybara/javascript.rb
84
+ - lib/filet-capybara/version.rb
85
+ - test/filet-capybara/integration_test.rb
86
+ - test/test_helper.rb
87
+ has_rdoc: true
88
+ homepage: ""
89
+ licenses: []
90
+
91
+ post_install_message:
92
+ rdoc_options: []
93
+
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ hash: 3
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ requirements: []
115
+
116
+ rubyforge_project: filet-capybara
117
+ rubygems_version: 1.3.7
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: Filet integration with capybara
121
+ test_files:
122
+ - test/filet-capybara/integration_test.rb
123
+ - test/test_helper.rb