-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3202 from masatake/rspec--rewrite
RSpec: rewrite in C language
- Loading branch information
Showing
23 changed files
with
447 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This csae is for observing the behavior of the parser when a broken | ||
input file is given. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--fields=+Klen | ||
--sort=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
RSpec.describe Order do | ||
context "with no items do | ||
it "behaves one way" do | ||
# ... | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--fields=+Klen | ||
--sort=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Order input.rb /^RSpec.describe Order do$/;" describe line:6 language:RSpec end:18 | ||
with no items input.rb /^ context "with no items" do$/;" context line:7 language:RSpec describe:Order end:11 | ||
with one item input.rb /^ context "with one item" do$/;" context line:13 language:RSpec describe:Order end:17 | ||
Calculator input.rb /^RSpec.describe Calculator do$/;" describe line:20 language:RSpec end:26 | ||
#add input.rb /^ describe '#add' do$/;" describe line:21 language:RSpec describe:Calculator end:25 | ||
Core input.rb /^module RSpec::Core$/;" module line:29 language:Ruby module:RSpec end:48 | ||
ExampleGroup input.rb /^ RSpec.describe ExampleGroup do$/;" describe line:30 language:RSpec end:47 | ||
when calling `#{method}`, an example group API, from within an example input.rb /^ context "when calling `#{method}`, an example group API, from within an example" do$/;" context line:32 language:RSpec describe:ExampleGroup end:42 | ||
Object describing nested example_groups input.rb /^ describe Object, "describing nested example_groups", :little_less_nested => 'yep' do$/;" describe line:45 language:RSpec describe:ExampleGroup end:46 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# | ||
# Randomly taken from https://github.com/rspec/rspec-core | ||
# https://github.com/rspec/rspec-core/blob/master/LICENSE.md | ||
# | ||
|
||
RSpec.describe Order do | ||
context "with no items" do | ||
it "behaves one way" do | ||
# ... | ||
end | ||
end | ||
|
||
context "with one item" do | ||
it "behaves another way" do | ||
# ... | ||
end | ||
end | ||
end | ||
|
||
RSpec.describe Calculator do | ||
describe '#add' do | ||
it 'returns the sum of its arguments' do | ||
expect(Calculator.new.add(1, 2)).to eq(3) | ||
end | ||
end | ||
end | ||
|
||
# Taken from rspec-core/spec/rspec/core/example_group_spec.rb | ||
module RSpec::Core | ||
RSpec.describe ExampleGroup do | ||
%w[ describe context let before it it_behaves_like ].each do |method| | ||
context "when calling `#{method}`, an example group API, from within an example" do | ||
it "tells the user they are in the wrong scope for that API" do | ||
ex = nil | ||
|
||
RSpec.describe do | ||
ex = example { __send__(method, "foo") } | ||
end.run | ||
|
||
expect(ex).to fail_with(ExampleGroup::WrongScopeError) | ||
end | ||
end | ||
end | ||
|
||
describe Object, "describing nested example_groups", :little_less_nested => 'yep' do | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.