Skip to content

Commit aae9741

Browse files
Merge pull request #12 from sue445/feature/power_assert
Add rspec-power_assert example
2 parents 627d292 + 43bc1b0 commit aae9741

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: ruby
22
rvm:
3-
- 1.9
43
- 2.0
54
- 2.1
65
- 2.2

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
22

33
group :development do
44
gem 'rspec', '~> 3.1.0'
5+
gem 'rspec-power_assert'
56

67
gem 'guard-rspec', "~> 4.3.1"
78

Gemfile.lock

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ GEM
2626
rb-inotify (>= 0.9)
2727
lumberjack (1.0.9)
2828
method_source (0.8.2)
29+
power_assert (0.2.1)
2930
pry (0.10.1)
3031
coderay (~> 1.1.0)
3132
method_source (~> 0.8.1)
@@ -45,6 +46,9 @@ GEM
4546
rspec-support (~> 3.1.0)
4647
rspec-mocks (3.1.3)
4748
rspec-support (~> 3.1.0)
49+
rspec-power_assert (0.2.0)
50+
power_assert (~> 0.2.0)
51+
rspec (>= 2.14)
4852
rspec-support (3.1.2)
4953
slop (3.6.0)
5054
thor (0.19.1)
@@ -60,3 +64,4 @@ DEPENDENCIES
6064
libnotify
6165
rb-notifu
6266
rspec (~> 3.1.0)
67+
rspec-power_assert

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ TDDBC for Ruby with RSpec
88
## 動作確認環境
99
* ruby 2.1.x
1010
* ruby 2.0.x
11-
* ruby 1.9.x
11+
12+
ruby 1.9以前では動きません
1213

1314
## セットアップ
1415
```bash

spec/lib/sample_spec.rb

+8
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@
1818
let(:greeting){ "Yeah!" }
1919
it { should eq "Yeah! TDD BootCamp!" }
2020
end
21+
22+
describe "Using power assert " do
23+
let(:greeting){ "Wow!" }
24+
25+
it do
26+
is_asserted_by{ sample.say(greeting) == "Wow! TDD BootCamp!" }
27+
end
28+
end
2129
end
2230
end

spec/spec_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
root_dir = File.expand_path(File.dirname(__FILE__) + "/..")
2121
Dir["#{root_dir}/lib/**/*.rb"].each { |f| require f }
2222

23+
require "rspec-power_assert"
24+
2325
RSpec.configure do |config|
2426
# rspec-expectations config goes here. You can use an alternate
2527
# assertion/expectation library such as wrong or the stdlib/minitest

0 commit comments

Comments
 (0)