diff options
author | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2015-01-12 10:13:58 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2015-01-12 10:13:58 +0100 |
commit | 4f065f63125907b3a4f72fbab8722c58ccab41c1 (patch) | |
tree | 3add5b782e0c86ffcf61d1b4e4dae769b7aa89c4 /spec/board_spec.rb | |
parent | 6b69e8e7806ade8fc36505f9ca358edd1572acef (diff) | |
download | edoors-ruby-4f065f63125907b3a4f72fbab8722c58ccab41c1.zip edoors-ruby-4f065f63125907b3a4f72fbab8722c58ccab41c1.tar.gz |
Diffstat (limited to 'spec/board_spec.rb')
-rw-r--r-- | spec/board_spec.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/board_spec.rb b/spec/board_spec.rb index 554ede0..b3300f6 100644 --- a/spec/board_spec.rb +++ b/spec/board_spec.rb @@ -18,10 +18,10 @@ describe Edoors::Board do board = Edoors::Board.new 'hell', @spin p0 = board.require_p p1 = board.require_p Edoors::Particle - (p0===p1).should be_false + expect(p0===p1).to be_falsey board.release_p p0 p2 = board.require_p - (p0===p2).should be_true + expect(p0===p2).to be_truthy end # it "particle wait and merge" do @@ -30,13 +30,13 @@ describe Edoors::Board do p0['k1'] = 'neither' p0['k2'] = 'v2' p0.set_link_keys 'k0', 'k2' - p0.link_value.should == {'k0'=>'v0','k2'=>'v2'} + expect(p0.link_value).to be == {'k0'=>'v0','k2'=>'v2'} p1 = Edoors::Particle.new p1['k0'] = 'v0' p1['k1'] = 'nore' p1['k2'] = 'v2' p1.set_link_keys 'k0', 'k2' - p1.link_value.should == {'k0'=>'v0','k2'=>'v2'} + expect(p1.link_value).to be == {'k0'=>'v0','k2'=>'v2'} P0 = p0 P1 = p1 class Board0 < Edoors::Board @@ -58,27 +58,27 @@ describe Edoors::Board do end b0 = Board0.new 'door0', @spin b0.process_p p0 - p0.merged(0).should be_nil + expect(p0.merged(0)).to be_nil b0.process_p p1 - b0.ok.should be_true - b0.follow.should be_false + expect(b0.ok).to be_truthy + expect(b0.follow).to be_falsey # p1.merged_shift # b0.process_p p0 - p0.merged(0).should be_nil + expect(p0.merged(0)).to be_nil # need to set it to p0 too, so case in Board0 is ok p0.add_dst Edoors::ACT_FOLLOW p0.split_dst! p1.add_dst Edoors::ACT_FOLLOW p1.split_dst! b0.process_p p1 - b0.ok.should be_true - b0.follow.should be_true + expect(b0.ok).to be_truthy + expect(b0.follow).to be_truthy p2 = b0.require_p p2.set_dst! Edoors::ACT_PASS_THROUGH, b0 b0.process_p p2 - b0.pass_through.should be true + expect(b0.pass_through).to be true end # it "keep! and flush!" do @@ -100,9 +100,9 @@ describe Edoors::Board do p3 = Edoors::Particle.new p3.set_dst! Edoors::ACT_FOLLOW, b0 b0.process_p p3 - (b0.get({}).merged_length+1).should == 4 + expect(b0.get({}).merged_length+1).to be == 4 b0.flush! - b0.get({}).should be_nil + expect(b0.get({})).to be_nil end # it "board->json->board" do @@ -114,8 +114,8 @@ describe Edoors::Board do board.process_p p0 board.process_p p1 hell = Edoors::Board.json_create( JSON.load( JSON.generate(board) ) ) - board.name.should eql hell.name - JSON.generate(board).should eql JSON.generate(hell) + expect(board.name).to eql hell.name + expect(JSON.generate(board)).to eql JSON.generate(hell) end # end |