filet 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -3,3 +3,4 @@
3
3
  Gemfile.lock
4
4
  pkg/*
5
5
  /.rvmrc
6
+ *.rbc
data/Gemfile CHANGED
@@ -3,4 +3,9 @@ source "http://rubygems.org"
3
3
  # Specify your gem's dependencies in filet.gemspec
4
4
  gemspec
5
5
 
6
- gem 'ruby-debug'
6
+ gem 'rake'
7
+
8
+ unless ENV["TRAVIS"]
9
+ gem 'ruby-debug19', :platforms => :ruby_19
10
+ gem 'ruby-debug', :platforms => :mri_18
11
+ end
data/Rakefile CHANGED
@@ -1 +1,11 @@
1
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 << '.'
9
+ t.test_files = FileList['test/**/*_test.rb']
10
+ t.verbose = true
11
+ end
data/Readme.md CHANGED
@@ -10,8 +10,10 @@ Filet is a dsl for acceptance testing on top of Test::Unit.
10
10
 
11
11
  To use filet just include in your test_helper
12
12
 
13
- require 'filet'
14
- include Filet
13
+ ```ruby
14
+ require 'filet'
15
+ include Filet
16
+ ```
15
17
 
16
18
  ## Hooks
17
19
 
@@ -21,18 +23,46 @@ We provide several hooks for options processing.
21
23
 
22
24
  This allows to process the options you pass for the feature
23
25
 
24
- Filet.feature_hook do |base, options|
25
- base.send(:include, Capybara)
26
- end
26
+ ```ruby
27
+ Filet.feature_hook do |base, options|
28
+ base.send(:include, Capybara)
29
+ end
30
+ ```
27
31
 
28
32
  2. Filet.context_hook
29
33
 
30
34
  This allows to process the options you pass for the context
31
35
 
32
- Filet.context_hook do |base, options|
33
- base.send(:include, SomeModule) if options[:js]
36
+ ```ruby
37
+ Filet.context_hook do |base, options|
38
+ base.send(:include, SomeModule) if options[:js]
39
+ end
40
+ ```
41
+
42
+ ## Example
43
+
44
+ ```ruby
45
+ feature 'Creating a post', %{
46
+ As a user
47
+ I want to create a post
48
+ In order to show it to people
49
+ } do
50
+
51
+ scenario 'Everything goes fine after a submit' do
52
+ # test code
53
+ end
54
+
55
+ context 'Something goes wrong', :js => true do
56
+ scenario 'my keyboard stopped working' do
57
+ # test code
34
58
  end
35
59
 
60
+ scenario 'I forgot to fill up the form' do
61
+ # test code
62
+ end
63
+ end
64
+ end
65
+ ```
36
66
  ## Acknowledgements
37
67
 
38
68
  We'd like to thank our employer XING AG for letting us work on this project as part of our innovation time and releasing it as open source.
@@ -49,12 +49,14 @@ module Filet
49
49
  end
50
50
 
51
51
  def create_class(name, superclass, &block)
52
- klass = Class.new(superclass, &block)
52
+ klass = Class.new(superclass)
53
53
  name = name.gsub(/(^\d*|\W)/, ' ').lstrip
54
54
  klass_name = name.gsub(/(^[a-z]|\s+\w)/).each do |match|
55
55
  match.lstrip.upcase
56
56
  end
57
57
 
58
- superclass.const_set klass_name, klass
58
+ const = superclass.const_set klass_name, klass
59
+ const.class_eval(&block) if block
60
+ const
59
61
  end
60
62
  end
data/lib/filet/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Filet
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,5 +1,3 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
1
  require 'test/unit'
4
2
  require 'filet/test_case'
5
3
 
@@ -105,8 +103,8 @@ module Filet
105
103
  end
106
104
  end
107
105
 
108
- assert klass.instance_methods.include?("test_Scenario_description")
109
- assert context_klass.instance_methods.include?("test_Nested_Scenario")
106
+ assert klass.method_defined?("test_Scenario_description")
107
+ assert context_klass.method_defined?("test_Nested_Scenario")
110
108
  end
111
109
 
112
110
  def teardown
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-07-22 00:00:00.000000000 +02:00
13
+ date: 2011-08-01 00:00:00.000000000 +02:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
  description: Extension for Test::Unit to have a Steak-like DSL for acceptance testing