Skip to content

Commit 09a56f8

Browse files
author
sueyoshi_go
committed
Add power_assert example
1 parent 627d292 commit 09a56f8

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
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

Lines changed: 5 additions & 0 deletions
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

spec/lib/sample_spec.rb

Lines changed: 8 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)