Skip to content

Commit c414732

Browse files
author
masarakki
committed
add rspec
1 parent d816af8 commit c414732

7 files changed

+103
-1
lines changed

.rspec

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--color
2+
--format doc
3+
--warnings
4+
--require spec_helper

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: ruby
2+
rvm:
3+
- 2.0.0
4+
- 2.1.2

Rakefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
require "bundler/gem_tasks"
1+
require 'bundler/gem_tasks'
2+
require 'rspec/core/rake_task'
3+
4+
RSpec::Core::RakeTask.new(:spec)
5+
6+
task :default => :spec

ikazuchi.gemspec

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
2121

2222
spec.add_development_dependency "bundler", "~> 1.3"
2323
spec.add_development_dependency "rake"
24+
spec.add_development_dependency "rspec"
2425

2526
Ikazuchi::Definition.dependencies.each do |dependency|
2627
spec.add_dependency dependency.name, dependency.requirement.to_s

spec/ikazuchi/definition_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require 'spec_helper'
2+
3+
describe Ikazuchi::Definition do
4+
it { expect(Ikazuchi::Definition.dependencies).to all( be_a Bundler::Dependency ) }
5+
end

spec/ikazuchi_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require 'spec_helper'
2+
3+
describe Ikazuchi do
4+
it { expect(Ikazuchi::VERSION).not_to be_nil }
5+
end

spec/spec_helper.rb

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# This file was generated by the `rspec --init` command. Conventionally, all
2+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
4+
# file to always be loaded, without a need to explicitly require it in any files.
5+
#
6+
# Given that it is always loaded, you are encouraged to keep this file as
7+
# light-weight as possible. Requiring heavyweight dependencies from this file
8+
# will add to the boot time of your test suite on EVERY test run, even for an
9+
# individual file that may not need all of that loaded. Instead, make a
10+
# separate helper file that requires this one and then use it only in the specs
11+
# that actually need it.
12+
#
13+
# The `.rspec` file also contains a few flags that are not defaults but that
14+
# users commonly want.
15+
#
16+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17+
RSpec.configure do |config|
18+
# The settings below are suggested to provide a good initial experience
19+
# with RSpec, but feel free to customize to your heart's content.
20+
=begin
21+
# These two settings work together to allow you to limit a spec run
22+
# to individual examples or groups you care about by tagging them with
23+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
24+
# get run.
25+
config.filter_run :focus
26+
config.run_all_when_everything_filtered = true
27+
28+
# Many RSpec users commonly either run the entire suite or an individual
29+
# file, and it's useful to allow more verbose output when running an
30+
# individual spec file.
31+
if config.files_to_run.one?
32+
# Use the documentation formatter for detailed output,
33+
# unless a formatter has already been configured
34+
# (e.g. via a command-line flag).
35+
config.default_formatter = 'doc'
36+
end
37+
38+
# Print the 10 slowest examples and example groups at the
39+
# end of the spec run, to help surface which specs are running
40+
# particularly slow.
41+
config.profile_examples = 10
42+
43+
# Run specs in random order to surface order dependencies. If you find an
44+
# order dependency and want to debug it, you can fix the order by providing
45+
# the seed, which is printed after each run.
46+
# --seed 1234
47+
config.order = :random
48+
49+
# Seed global randomization in this process using the `--seed` CLI option.
50+
# Setting this allows you to use `--seed` to deterministically reproduce
51+
# test failures related to randomization by passing the same `--seed` value
52+
# as the one that triggered the failure.
53+
Kernel.srand config.seed
54+
55+
# rspec-expectations config goes here. You can use an alternate
56+
# assertion/expectation library such as wrong or the stdlib/minitest
57+
# assertions if you prefer.
58+
config.expect_with :rspec do |expectations|
59+
# Enable only the newer, non-monkey-patching expect syntax.
60+
# For more details, see:
61+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
62+
expectations.syntax = :expect
63+
end
64+
65+
# rspec-mocks config goes here. You can use an alternate test double
66+
# library (such as bogus or mocha) by changing the `mock_with` option here.
67+
config.mock_with :rspec do |mocks|
68+
# Enable only the newer, non-monkey-patching expect syntax.
69+
# For more details, see:
70+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71+
mocks.syntax = :expect
72+
73+
# Prevents you from mocking or stubbing a method that does not exist on
74+
# a real object. This is generally recommended.
75+
mocks.verify_partial_doubles = true
76+
end
77+
=end
78+
end

0 commit comments

Comments
 (0)