spec/unit/matcher/terminal/test_terminal_match.rb in sexpr-0.6.0 vs spec/unit/matcher/terminal/test_terminal_match.rb in sexpr-1.0.0
- old
+ new
@@ -10,98 +10,98 @@
context "with a Regexp" do
let(:arg){ /^[a-z]+$/ }
it 'matches a matching string' do
- terminal.terminal_match?("hello").should be_true
+ terminal.terminal_match?("hello").should be_truthy
end
it 'matches a non matching string' do
- terminal.terminal_match?("12").should be_false
+ terminal.terminal_match?("12").should be_falsey
end
it 'does not match a sexp' do
- terminal.terminal_match?([:sexp, "Hello World"]).should be_false
+ terminal.terminal_match?([:sexp, "Hello World"]).should be_falsey
end
it 'does not match nil' do
- terminal.terminal_match?(nil).should be_false
+ terminal.terminal_match?(nil).should be_falsey
end
end
context "with true" do
let(:arg){ true }
it 'matches true' do
- terminal.terminal_match?(true).should be_true
+ terminal.terminal_match?(true).should be_truthy
end
it 'does not match false/nil' do
- terminal.terminal_match?(false).should be_false
- terminal.terminal_match?(nil).should be_false
+ terminal.terminal_match?(false).should be_falsey
+ terminal.terminal_match?(nil).should be_falsey
end
it 'does not match anything else' do
- terminal.terminal_match?([]).should be_false
- terminal.terminal_match?([:sexp]).should be_false
- terminal.terminal_match?("true").should be_false
+ terminal.terminal_match?([]).should be_falsey
+ terminal.terminal_match?([:sexp]).should be_falsey
+ terminal.terminal_match?("true").should be_falsey
end
end
context "with false" do
let(:arg){ false }
it 'matches false' do
- terminal.terminal_match?(false).should be_true
+ terminal.terminal_match?(false).should be_truthy
end
it 'does not match true/nil' do
- terminal.terminal_match?(true).should be_false
- terminal.terminal_match?(nil).should be_false
+ terminal.terminal_match?(true).should be_falsey
+ terminal.terminal_match?(nil).should be_falsey
end
it 'does not match anything else' do
- terminal.terminal_match?([]).should be_false
- terminal.terminal_match?([:sexp]).should be_false
- terminal.terminal_match?("false").should be_false
+ terminal.terminal_match?([]).should be_falsey
+ terminal.terminal_match?([:sexp]).should be_falsey
+ terminal.terminal_match?("false").should be_falsey
end
end
context "with nil" do
let(:arg){ nil }
it 'matches nil' do
- terminal.terminal_match?(nil).should be_true
+ terminal.terminal_match?(nil).should be_truthy
end
it 'does not match true/false' do
- terminal.terminal_match?(true).should be_false
- terminal.terminal_match?(false).should be_false
+ terminal.terminal_match?(true).should be_falsey
+ terminal.terminal_match?(false).should be_falsey
end
it 'does not match anything else' do
- terminal.terminal_match?([]).should be_false
- terminal.terminal_match?([:sexp]).should be_false
- terminal.terminal_match?("nil").should be_false
+ terminal.terminal_match?([]).should be_falsey
+ terminal.terminal_match?([:sexp]).should be_falsey
+ terminal.terminal_match?("nil").should be_falsey
end
end
context "with a Class" do
let(:arg){ Symbol }
it 'matches a symbol' do
- terminal.terminal_match?(:hello).should be_true
+ terminal.terminal_match?(:hello).should be_truthy
end
it 'does not match a string' do
- terminal.terminal_match?("hello").should be_false
+ terminal.terminal_match?("hello").should be_falsey
end
it 'does not match anything else' do
- terminal.terminal_match?(nil).should be_false
- terminal.terminal_match?([]).should be_false
- terminal.terminal_match?([:sexp]).should be_false
- terminal.terminal_match?("nil").should be_false
+ terminal.terminal_match?(nil).should be_falsey
+ terminal.terminal_match?([]).should be_falsey
+ terminal.terminal_match?([:sexp]).should be_falsey
+ terminal.terminal_match?("nil").should be_falsey
end
end
end
end
\ No newline at end of file