rspec-feature-expectations 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b1066831f10927475d801f42ce1eacd1f63cd605
4
+ data.tar.gz: ff41474f632a8db50e7c47ca685d855d99240139
5
+ SHA512:
6
+ metadata.gz: 739566c046ee8e4240db11b5ccfedfe90dc8a5445af403a7c12d0b2a213c0ac1d3c271932f6e6800ba392dc64e1330c10ab29f53c1f7a22895a7800eed610886
7
+ data.tar.gz: 1c4540860176c1d53ae0fd6b85c9dfcf9fe15af610e753b0ca18473c5c56fda50c756dd26db588728f70a138d9f066453498b26fadf2afaaee06c9541381a88f
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rspec", "~> 3.0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "bundler", "~> 1.0"
12
+ gem "jeweler", "~> 2.0", ">= 2.0.1"
13
+ gem "simplecov", "~> 0"
14
+ end
@@ -0,0 +1,77 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.3.6)
5
+ builder (3.2.2)
6
+ descendants_tracker (0.0.4)
7
+ thread_safe (~> 0.3, >= 0.3.1)
8
+ diff-lcs (1.2.5)
9
+ docile (1.1.5)
10
+ faraday (0.9.0)
11
+ multipart-post (>= 1.2, < 3)
12
+ git (1.2.7)
13
+ github_api (0.11.3)
14
+ addressable (~> 2.3)
15
+ descendants_tracker (~> 0.0.1)
16
+ faraday (~> 0.8, < 0.10)
17
+ hashie (>= 1.2)
18
+ multi_json (>= 1.7.5, < 2.0)
19
+ nokogiri (~> 1.6.0)
20
+ oauth2
21
+ hashie (3.0.0)
22
+ highline (1.6.21)
23
+ jeweler (2.0.1)
24
+ builder
25
+ bundler (>= 1.0)
26
+ git (>= 1.2.5)
27
+ github_api
28
+ highline (>= 1.6.15)
29
+ nokogiri (>= 1.5.10)
30
+ rake
31
+ rdoc
32
+ json (1.8.1)
33
+ jwt (1.0.0)
34
+ mini_portile (0.6.0)
35
+ multi_json (1.10.1)
36
+ multi_xml (0.5.5)
37
+ multipart-post (2.0.0)
38
+ nokogiri (1.6.2.1)
39
+ mini_portile (= 0.6.0)
40
+ oauth2 (0.9.4)
41
+ faraday (>= 0.8, < 0.10)
42
+ jwt (~> 1.0)
43
+ multi_json (~> 1.3)
44
+ multi_xml (~> 0.5)
45
+ rack (~> 1.2)
46
+ rack (1.5.2)
47
+ rake (10.3.2)
48
+ rdoc (3.12.2)
49
+ json (~> 1.4)
50
+ rspec (3.0.0)
51
+ rspec-core (~> 3.0.0)
52
+ rspec-expectations (~> 3.0.0)
53
+ rspec-mocks (~> 3.0.0)
54
+ rspec-core (3.0.2)
55
+ rspec-support (~> 3.0.0)
56
+ rspec-expectations (3.0.2)
57
+ diff-lcs (>= 1.2.0, < 2.0)
58
+ rspec-support (~> 3.0.0)
59
+ rspec-mocks (3.0.2)
60
+ rspec-support (~> 3.0.0)
61
+ rspec-support (3.0.2)
62
+ simplecov (0.8.2)
63
+ docile (~> 1.1.0)
64
+ multi_json
65
+ simplecov-html (~> 0.8.0)
66
+ simplecov-html (0.8.0)
67
+ thread_safe (0.3.4)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ bundler (~> 1.0)
74
+ jeweler (~> 2.0, >= 2.0.1)
75
+ rdoc (~> 3.12)
76
+ rspec (~> 3.0)
77
+ simplecov (~> 0)
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Ian Kenney
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ = rspec-feature-expectations
2
+
3
+ Set of rspec matcher to help with feature specs
4
+
5
+ == include_text
6
+
7
+ check content order
8
+
9
+ describe "hello world" do
10
+ it { is_expected.to include_text("hello").before_text("world") }
11
+ it { is_expected.not_to include_text("world").before_text("hello") }
12
+ end
13
+
14
+
15
+ == Contributing to rspec-feature-expectations
16
+
17
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
18
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
19
+ * Fork the project.
20
+ * Start a feature/bugfix branch.
21
+ * Commit and push until you are happy with your contribution.
22
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
23
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
24
+
25
+ == Copyright
26
+
27
+ Copyright (c) 2014 Ian Kenney. See LICENSE.txt for
28
+ further details.
29
+
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "rspec-feature-expectations"
18
+ gem.homepage = "http://github.com/ikenney/rspec-feature-expectations"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{rspec matchers for feature specs}
21
+ gem.description = %Q{some rspec matchers for feature specs}
22
+ gem.email = "ian@lostock.co.uk"
23
+ gem.authors = ["Ian Kenney"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ desc "Code coverage detail"
35
+ task :simplecov do
36
+ ENV['COVERAGE'] = "true"
37
+ Rake::Task['spec'].execute
38
+ end
39
+
40
+ task :default => :spec
41
+
42
+ require 'rdoc/task'
43
+ Rake::RDocTask.new do |rdoc|
44
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
45
+
46
+ rdoc.rdoc_dir = 'rdoc'
47
+ rdoc.title = "rspec-feature-expectations #{version}"
48
+ rdoc.rdoc_files.include('README*')
49
+ rdoc.rdoc_files.include('lib/**/*.rb')
50
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.4
@@ -0,0 +1 @@
1
+ require 'rspec-feature-expectations/include_text'
@@ -0,0 +1,18 @@
1
+ RSpec::Matchers.define :include_text do |first|
2
+ match do |content|
3
+ content.index(first) && content.index(@second) &&
4
+ content.index(first) < content.index(@second)
5
+ end
6
+
7
+ chain :before_text do |second|
8
+ @second = second
9
+ end
10
+
11
+ description do
12
+ "contain '#{expected}' before '#{@second}'"
13
+ end
14
+
15
+ failure_message do |actual|
16
+ "Expected '#{actual}' to contain '#{expected}' before '#{@second}'"
17
+ end
18
+ end
@@ -0,0 +1,66 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: rspec-feature-expectations 0.0.4 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "rspec-feature-expectations"
9
+ s.version = "0.0.4"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Ian Kenney"]
14
+ s.date = "2014-07-12"
15
+ s.description = "some rspec matchers for feature specs"
16
+ s.email = "ian@lostock.co.uk"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".rspec",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE.txt",
27
+ "README.rdoc",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "lib/rspec-feature-expectations.rb",
31
+ "lib/rspec-feature-expectations/include_text.rb",
32
+ "rspec-feature-expectations.gemspec",
33
+ "spec/rspec-feature-expectations/include_text_spec.rb",
34
+ "spec/rspec-feature-expectations_spec.rb",
35
+ "spec/spec_helper.rb"
36
+ ]
37
+ s.homepage = "http://github.com/ikenney/rspec-feature-expectations"
38
+ s.licenses = ["MIT"]
39
+ s.rubygems_version = "2.3.0"
40
+ s.summary = "rspec matchers for feature specs"
41
+
42
+ if s.respond_to? :specification_version then
43
+ s.specification_version = 4
44
+
45
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
+ s.add_development_dependency(%q<rspec>, ["~> 3.0"])
47
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
48
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
49
+ s.add_development_dependency(%q<jeweler>, [">= 2.0.1", "~> 2.0"])
50
+ s.add_development_dependency(%q<simplecov>, ["~> 0"])
51
+ else
52
+ s.add_dependency(%q<rspec>, ["~> 3.0"])
53
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
54
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
55
+ s.add_dependency(%q<jeweler>, [">= 2.0.1", "~> 2.0"])
56
+ s.add_dependency(%q<simplecov>, ["~> 0"])
57
+ end
58
+ else
59
+ s.add_dependency(%q<rspec>, ["~> 3.0"])
60
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
61
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
62
+ s.add_dependency(%q<jeweler>, [">= 2.0.1", "~> 2.0"])
63
+ s.add_dependency(%q<simplecov>, ["~> 0"])
64
+ end
65
+ end
66
+
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+ require 'rspec-feature-expectations/include_text'
3
+
4
+ RSpec.describe "include_text before matcher" do
5
+ describe "hello goodbye" do
6
+ subject{ "hello goodbye"}
7
+ it { is_expected.to include_text("hello").before_text("goodbye") }
8
+ it { is_expected.to include_text("ello").before_text("by") }
9
+ it { is_expected.not_to include_text("goodbye").before_text("hello") }
10
+ it { is_expected.not_to include_text("hi").before_text("goodbye") }
11
+ it { is_expected.not_to include_text("hello").before_text("see ya") }
12
+ it { is_expected.not_to include_text("hi").before_text("see ya") }
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe "included matchers" do
4
+ describe "include_text" do
5
+ it { is_expected.to include_text("inc").before_text("tex")}
6
+ end
7
+ end
@@ -0,0 +1,29 @@
1
+ require 'simplecov'
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter 'test_frameworks'
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
17
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
18
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
19
+
20
+ require 'rspec'
21
+ require 'rspec-feature-expectations'
22
+
23
+ # Requires supporting files with custom matchers and macros, etc,
24
+ # in ./support/ and its subdirectories.
25
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
26
+
27
+ RSpec.configure do |config|
28
+
29
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-feature-expectations
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Ian Kenney
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.12'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jeweler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 2.0.1
62
+ - - "~>"
63
+ - !ruby/object:Gem::Version
64
+ version: '2.0'
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 2.0.1
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: simplecov
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ description: some rspec matchers for feature specs
90
+ email: ian@lostock.co.uk
91
+ executables: []
92
+ extensions: []
93
+ extra_rdoc_files:
94
+ - LICENSE.txt
95
+ - README.rdoc
96
+ files:
97
+ - ".document"
98
+ - ".rspec"
99
+ - Gemfile
100
+ - Gemfile.lock
101
+ - LICENSE.txt
102
+ - README.rdoc
103
+ - Rakefile
104
+ - VERSION
105
+ - lib/rspec-feature-expectations.rb
106
+ - lib/rspec-feature-expectations/include_text.rb
107
+ - rspec-feature-expectations.gemspec
108
+ - spec/rspec-feature-expectations/include_text_spec.rb
109
+ - spec/rspec-feature-expectations_spec.rb
110
+ - spec/spec_helper.rb
111
+ homepage: http://github.com/ikenney/rspec-feature-expectations
112
+ licenses:
113
+ - MIT
114
+ metadata: {}
115
+ post_install_message:
116
+ rdoc_options: []
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ requirements: []
130
+ rubyforge_project:
131
+ rubygems_version: 2.3.0
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: rspec matchers for feature specs
135
+ test_files: []