Permalink
Browse files

updated README and created gem

  • Loading branch information...
1 parent 4ce81e4 commit cc2beeb09208a3356999c8ad87000d2dc5117ec9 @despo despo committed Feb 10, 2012
Showing with 110 additions and 7 deletions.
  1. +1 −5 Gemfile
  2. +9 −2 Gemfile.lock
  3. +69 −0 README.md
  4. +3 −0 lib/prickle/version.rb
  5. +28 −0 prickle.gemspec
View
@@ -1,7 +1,3 @@
source :rubygems
-group :development do
- gem 'capybara'
- gem 'rspec'
- gem 'sinatra'
-end
+gemspec
View
@@ -1,3 +1,9 @@
+PATH
+ remote: .
+ specs:
+ prickle (0.0.1)
+ capybara
+
GEM
remote: http://rubygems.org/
specs:
@@ -47,5 +53,6 @@ PLATFORMS
DEPENDENCIES
capybara
- rspec
- sinatra
+ prickle!
+ rspec (~> 2.8.0)
+ sinatra (~> 1.3.2)
View
@@ -1 +1,70 @@
![](http://github.com/despo/prickle/raw/master/prickle.png)
+
+## Configuration
+
+To install prickle execute
+
+```ruby
+gem install prickle
+```
+
+and to configure
+
+```ruby
+require 'prickle/capybara'
+
+World do
+ include Capybara::DSL
+ include Prickle::Capybara #include it after Capybara
+end
+```
+
+## Usage
+
+### Find elements by any html tag(s)
+
+```ruby
+ element(:href => "http://google.com")
+ element(:name => "blue")
+ element(:id => "key")
+ element(:class => "key", :id => "button")
+```
+
+### Find elements by type and html tag(s)
+
+```ruby
+ element(:link,:href => "http://google.com")
+ element(:input, :name => "blue")
+``
+
+### Apply a search, a click or a text matcher
+
+``ruby
+
+element(:name => "flower")*.exists?*
+element(:name => "flower")*.click*
+element(:name => "flower")*.contains_text? "Roses"*
+```
+
+## Alternative syntax
+
+### Find
+
+```ruby
+ find_by_name "green"
+
+ find_button_by_name "green" #find_<element_tag>_by_name "<name>"
+```
+
+## Click
+
+```ruby
+ click_by_name "blue"
+ click_input_by_name "blue" #click_<element_tag>_by_name "<name>"
+``
+
+### Match text
+
+```ruby
+ div_contains_text? "text" #<element_tag>_contains_text? "text"
+```
View
@@ -0,0 +1,3 @@
+module Prickle
+ VERSION = '0.0.1'
+end
View
@@ -0,0 +1,28 @@
+$:.push File.expand_path("../lib", __FILE__)
+require "prickle/version"
+
+Gem::Specification.new do |s|
+ s.name = "prickle"
+ s.version = Prickle::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.author = "Despo Pentara"
+ s.email = "despo@extractmethod.com"
+ s.homepage = "https://github.com/ExtractMethod/prickle"
+ s.summary = "A simple DSL wrapped around Capybara for matching elements using html tags."
+ s.description = "A simple DSL wrapped around Capybara for matching elements using html tags."
+ s.required_ruby_version = '>= 1.9.2'
+
+ s.licenses = ["MIT"]
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {spec}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.add_dependency "capybara"
+
+ s.add_development_dependency "capybara"
+ s.add_development_dependency "rspec", "~> 2.8.0"
+ s.add_development_dependency "sinatra", "~> 1.3.2"
+end
+

0 comments on commit cc2beeb

Please sign in to comment.