Skip to content

Commit dbbb163

Browse files
committedNov 1, 2014
Fix and add specs for one-liner should and is_expected syntax
1 parent 99f5fb7 commit dbbb163

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

‎opal/opal/rspec/fixes.rb

+10
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,13 @@ def save_original_method!
9696
@original_method ||= @method_stasher.original_method
9797
end
9898
end
99+
100+
module RSpec
101+
module Core
102+
module MemoizedHelpers
103+
def is_expected
104+
expect(subject)
105+
end
106+
end
107+
end
108+
end

‎spec/should_syntax_spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
describe "One-liner should syntax" do
2+
subject { 42 }
3+
4+
describe "should" do
5+
it { should == 42 }
6+
it { should_not == 43 }
7+
end
8+
9+
describe "is_expected" do
10+
it { is_expected.to eq(42) }
11+
it { is_expected.to_not eq(43) }
12+
end
13+
end

0 commit comments

Comments
 (0)
Please sign in to comment.